[Top][All Lists]

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

Help needed to build shared library with libtool

From: David Aldrich
Subject: Help needed to build shared library with libtool
Date: Thu, 13 Oct 2011 08:45:38 +0000



I am using libtool in a makefile to create a shared library containing my application code, which also links to wxWidgets libraries.  As a consequence of changing both platform (including gcc version) and wxWidgets packages, my makefile ceases to work.  It seems that the libtool command is trying to make a static, rather than a shared library.  I don’t understand libtool well enough to fix the problem and would be grateful of some help.  Although I have mentioned wxWidgets, I am inclined to think that it is more appropriate to ask help from the libtool community than the wxWidgets community.


Here is the failing command:


libtool --mode=link g++ -shared -o <my object files>  -rpath /usr/local/lib -rpath /usr/lib64 -pthread -Wl,-Bsymbolic-functions  -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  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 

libtool: link: g++ -o <my object files> -pthread -Wl,-Bsymbolic-functions -pthread  -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 /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ -lm /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ -lfontconfig /usr/lib/ /usr/lib/ /usr/lib/ -lrt /usr/lib/ -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/lib64

/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':

(.text+0x20): undefined reference to `main' 


Now, on the previous (working) environment, libtool created a command that started with:


g++ -shared -o /


whereas the failing command (above) starts with:


libtool: link: g++ -o


I realise that the absence of ‘-shared’ in the latter is probably causing my problem.  Why is it not present please?


Best regards




reply via email to

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