[Top][All Lists]

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

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

From: Satz Klauer
Subject: Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8
Date: Mon, 18 Mar 2013 11:39:02 +0100

This line looks a bit strange to me:

libtool: link: g++ -g -O2 -Wl,-whole-archive -Wl,-no-whole-archive -o
.libs/baz baz.o -Wl,-bind_at_load  ../foo/libfoo.a

g++ looks like some GCC-type compiler, so GNU-specifics should not be
a problem!? Nevertheless I don't know what a GNU-compiler would say
when you have a statement

-Wl,-whole-archive -Wl,-no-whole-archive

with no libraries to be linked in between...

On Mon, Mar 18, 2013 at 11:18 AM, Peter Johansson <address@hidden> wrote:
> On 3/18/13 4:03 PM, Satz Klauer wrote:
>> 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.
> Thanks, but unfortunately that seems to be a GNU specific feature. On OSX it
> results in failure saying:
> /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/
> 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

reply via email to

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