[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help needed to build shared library with libtool

From: Peter O'Gorman
Subject: Re: Help needed to build shared library with libtool
Date: Fri, 14 Oct 2011 08:55:43 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14

On 10/14/2011 08:45 AM, David Aldrich wrote:
Hi Peter

Thanks for your reply.
-shared is not a libtool flag

Oh, that's weird! We've been using that option for building other shared 
libraries for a long time.

Yes, and older libtools used to pass it along to the compiler driver, so on systems using gcc/g++ or where the compiler accepted the -shared flag to create a shared library it would work.

does it work if you do:

libtool --mode=link g++ -o<object files>  -rpath /usr/local/lib

That doesn't work, but the result is different:

libtool --mode=link g++ -o<my obj files>   -rpath /usr/local/lib 
-rpath /usr/lib64 -L/usr/lib64 -pthread   -L/usr/lib64   -lwx_gtk2u_richtext-2.8 
-lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 
-lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 
-lwx_baseu-2.8  -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 
-lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig 
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0

*** Warning: Linking the shared library against the non-libtool
*** objects<my obj files>  is not portable!

Your object files are created without using libtool?

ln: creating symbolic link `': Operation not supported
make: *** [] Error 1

That's a new one for me, you snipped the ln command that fails though.

I don't know how much you care about portability, if you aren't worried about it (previously your Makefile with older libtool would only create working shared libraries with compilers that understand -shared and where the shared library extension is .so), then you may be better off not using libtool at all, and just doing
g++ -shared -o ....

That does exclude Windows, Mac OS X, HP-UX, though, just on the ".so".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]