|
From: | Peter Johansson |
Subject: | Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8 |
Date: | Mon, 18 Mar 2013 20:18:41 +1000 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 |
On 3/18/13 4:03 PM, Satz Klauer wrote:
Thanks, but unfortunately that seems to be a GNU specific feature. On OSX it results in failure saying:It is not a libtool-specific thingy, you have to use these linking options: -Wl,-whole-archive -lyourlib.a -lyourlib2.a -Wl,-no-whole-archive This includes your static libraries libyourlib1.a and libyourlib2.a into the shared library. Please do not forget the "-Wl,-no-whole-archive" at the end to encapsulyte the libraries you wan to link this way.
/bin/sh ./libtool --tag=CXX --mode=link g++ -g -O2 -Wl,-whole-archive ../foo/libfoo.a -Wl,-no-whole-archive -o baz baz.o ../bar/libbar.la libtool: link: g++ -g -O2 -Wl,-whole-archive -Wl,-no-whole-archive -o .libs/baz baz.o -Wl,-bind_at_load ../foo/libfoo.a ../bar/.libs/libbar.dylib
/usr/bin/ld: unknown flag: -whole-archive collect2: ld returned 1 exit status make: *** [baz] Error 1 Cheers, Peter
[Prev in Thread] | Current Thread | [Next in Thread] |