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

Can you use it from the build tree, for example when you run perl -Ilib -MTamarLog -e e?

You should test the various stages one by one, ie first that it compiles, then that it runs from the build tree, and only if that works look towards installing.

Replies are listed 'Best First'.
Re^2: Creating my own perl module from c++ code
by tomerb (Novice) on Jul 22, 2009 at 08:31 UTC
    Well I have an update,
    I noticed that the "make install" didn't put the TamarLog.pm in the correct place.
    I put it in one of the @INC directories. and then I get a new and improved error:
    "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 foun"

    The thing is that this exact same process worked fine on a Win32 machine.
Re^2: Creating my own perl module from c++ code
by tomerb (Novice) on Jul 22, 2009 at 08:48 UTC
    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?
      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.
        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???