in reply to Re: Creating my own perl module from c++ code
in thread Creating my own perl module from c++ code

First of all thanks for your help,
I tried running it as you said:
root > perl -I./lib/ -MTamarLog -e 'my $x = new TamarLog(); print $x->PrintError("YESH\n");'
ld.so.1: perl: fatal: relocation error: file /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/TamarLog/TamarLog.so: symbol __1c2n6FI_pv_: referenced symbol not found
Killed

any idea?
  • Comment on Re^2: Creating my own perl module from c++ code

Replies are listed 'Best First'.
Re^3: Creating my own perl module from c++ code
by JavaFan (Canon) on Jul 22, 2009 at 09:01 UTC
    Well, in your build directory, ./lib is the directory where you may (but don't have to) work on your Perl sources. It's not the directory where the finished products are placed - neither the Perl modules, nor the C libraries. They are in subdirectories in blib. Try, after running 'make':
    perl -Iblib/lib -Iblib/arch -MTamarLog -e '...'
    But, assuming you have test files, should have succeeded, as this is what 'make test' does as well.
      I get the exact same error as before when I try this.
        Did you actually run a succesful make? Because the error seems to suggest it finds a TamarLog.so file in /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/TamarLog/ instead of picking up the one in ./blib/arch.
      here is the output of "nm ScriptLog.so":

      [57] | 0| 0|FUNC |GLOB |0 |UNDEF |__1c2k6Fpv_v_
      [53] | 0| 0|FUNC |GLOB |0 |UNDEF |__1c2n6FI_pv_
      [63] | 2552| 8|FUNC |GLOB |0 |8 |__1cFGoLog2t5B6M_v_

      any idea why did the compilation create them UNDEF???