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 ../bar/.libs/libbar.dylib
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 <troj...@gmail.com> 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/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 _______________________________________________ https://lists.gnu.org/mailman/listinfo/libtool