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

Reply via email to