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

You're trying to link an object (.o) file against a library. You should do that with the shared-object file (.so).

For example I use this commandline to link some of my XS code against a shared library.

cc -shared -L/usr/local/lib xs/Connection.o xs/Loudmouth.o xs/Message +.o \ xs/MessageHandler.o xs/MessageNode.o xs/Proxy.o xs/SSL.o perlmouth.o \ build/perlmouth-gtypes.o -o blib/arch/auto/Net/Jabber/Loudmouth/Loudm +outh.so \ -lloudmouth-1 -lglib-2.0 -lgobject-2.0 -lgthread-2.0

This works pretty well.

Another possibility would be to link the libmyprint object file (.o) together with helloworld.o into helloworld.so.

Cheers, Flo

Replies are listed 'Best First'.
Re^4: shared-obj linking in xs-module
by warlock (Initiate) on Mar 16, 2006 at 14:19 UTC
    Thank you, for your suggestion. It functions very well, but the problem is that you have collected all obj-files in the sh-obj file. My posted code is just a short example, but in the real case I have many sh-obj files, and some of these could be proprietary one, in this case I have only sh-obj files.

    What I can do, in this generic case?

      Exactly what I did in the code example I posted. Linking the generated shared object against the libraries. In that example that libraries are also external (not proprietary, though) and I don't have built them myself. I built my code with the headers that are provided with those libraries and then link against their shared objects, which are more than one as well.

      Cheers, Flo

        Ok Cheers, but how con you do if you have only shared-objects? In C it would not be a problem.