libtool
[Top][All Lists]
Advanced

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

libtool won't link with static libraries


From: Adam Nielsen
Subject: libtool won't link with static libraries
Date: Thu, 28 Apr 2011 12:49:11 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.8.1.23) Gecko/20091130 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0

Hi all,

I'm trying to cross-compile a library under Linux to produce a Win32 .dll. It needs to link in with static Boost libraries (which were also cross compiled on the same machine) but libtool seems to refuse to do this:

*** Warning: Trying to link with static lib archive /usr/i486-mingw32/lib/libboost_filesystem-mt-s.a.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because the file extensions .a of this argument makes me believe
*** that it is just a static archive that I should not use here.

This is the libtool command in question - but as it is all handled by autoconf I'm not sure what I'm doing wrong!

/bin/sh ../libtool --tag=CXX --mode=link i486-mingw32-g++ -g -O2 -release 0.1 -version-info 0 -no-undefined -o libblah.la -rpath /usr/i486-mingw32/local/lib blah1.lo blah2.lo /usr/i486-mingw32/lib/libboost_system-mt-s.a /usr/i486-mingw32/lib/libboost_filesystem-mt-s.a /usr/i486-mingw32/lib/libboost_system-mt-s.a -L/usr/i486-mingw32/local/lib -lblah3

I get a second error the same as the first for the other .a file. The two libraries are definitely not being linked, because the next step in the process results in:

.libs/blah.o: In function `__static_initialization_and_destruction_0':
/usr/lib/gcc/i486-mingw32/4.5.2/../../../../i486-mingw32/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()' /usr/lib/gcc/i486-mingw32/4.5.2/../../../../i486-mingw32/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()' /usr/lib/gcc/i486-mingw32/4.5.2/../../../../i486-mingw32/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status

Can anyone offer any pointers as to what might be going on? Why won't libtool use the static library?

Many thanks,
Adam.




reply via email to

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