libtool
[Top][All Lists]
Advanced

[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: Fri, 14 Oct 2011 07:10:35 +0000

Hi 

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 libGUI.so <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 libGUI.so <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/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so /usr/lib/libatk-1.0.so 
/usr/lib/libgio-2.0.so /usr/lib/libpangoft2-1.0.so 
/usr/lib/libgdk_pixbuf-2.0.so -lm /usr/lib/libpangocairo-1.0.so 
/usr/lib/libcairo.so /usr/lib/libpango-1.0.so /usr/lib/libfreetype.so 
-lfontconfig /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so 
/usr/lib/libgthread-2.0.so -lrt /usr/lib/libglib-2.0.so -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 /libGUI.so

whereas the failing command (above) starts with:

       libtool: link: g++ -o libGUI.so

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

Best regards

David




reply via email to

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