in reply to Re^8: shared-obj linking in xs-module
in thread shared-obj linking in xs-module

Those object files are part of my XS glue. They are build from the .c files generated form my .xs files. They corespond to helloworld.o in your example. They are not part of the library I'm binding to perl.

Flo

Replies are listed 'Best First'.
Re^10: shared-obj linking in xs-module
by warlock (Initiate) on Mar 16, 2006 at 16:14 UTC
    Sorry, I did not understand youe example. I thought that you linked all obj-file in one sh-obj, and it functions off course. Now I have seen that you use the tipical "-L<path> -l<lib>" C options.

    I tried to do the same in my Makefile, but is does not function, and returns the following error:
    libmyprint.so: cannot open shared object file: No such file or directo +ry at /usr/local/lib/perl5/5.8.7/i686-linux/DynaLoader.pm line 230.
    It looks like that I must tell to Perl where is my sh-object. I am tring with @dl_library_path in pm-file, but no success again...

    have you a suggestion for me?

      Either you use rpath to code the path to the shared object file into helloworld.so, or you put libmyprint.so into a standard library path (/usr/lib, /lib, directories in /etc/ld.so.conf, ...) and run ldconfig afterwards, or you set the LD_LIBRARY_PATH environment variable to the path where libmyprint.so lives. As an alternative you can also build libmyprint as a static library and link it into helloworld.so as a statically. That of course depend on the vendor of the library you want to bind as it'll only work if they provide a static library.

      Cheers, Flo

        Ok it functions, thank you for your help and your unlimited patience. I hope that my little problem and your messages could be usefull for some other user, too.

        Thank you again Cheers,

        Best regards

        Warlock