libtool
[Top][All Lists]
Advanced

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

Re: libtool won't link with static libraries


From: Mike Frysinger
Subject: Re: libtool won't link with static libraries
Date: Fri, 29 Apr 2011 19:50:59 -0400
User-agent: KMail/1.13.6 (Linux/2.6.37.3; KDE/4.6.0; x86_64; ; )

On Wednesday, April 27, 2011 22:49:11 Adam Nielsen wrote:
> 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/syst
> em/error_code.hpp:214: undefined reference to
> `boost::system::generic_category()'
> /usr/lib/gcc/i486-mingw32/4.5.2/../../../../i486-mingw32/include/boost/syst
> em/error_code.hpp:215: undefined reference to
> `boost::system::generic_category()'
> /usr/lib/gcc/i486-mingw32/4.5.2/../../../../i486-mingw32/include/boost/syst
> em/error_code.hpp:216: undefined reference to
> `boost::system::system_category()'
> collect2: ld returned 1 exit status

when statically linking, order is significant
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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