At Sat, 03 Feb 2007 06:54:43 -0800 Paul Pluzhnikov <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] writes: > > > i want to make .so from multiple .a's > > On which platform? > > On Linux you can do this: > > # combine libbar.a and libbaz.a into libfoo.so > g++ -fPIC -shared -o libfoo.so -Wl,--whole-archive -lbar -lbaz > -Wl,--no-whole-archive > > On non-GNU-ld platforms you have to "explode" the archives: > > mkdir tmp.$$ && cd tmp.$$ && > ar x ../libbar.a && ar x ../libbaz.a && > g++ -fPIC -shared -o ../libfoo.so *.o && > cd .. && rm -rf tmp.$$ > > Cheers, The only gotcha is whether or not the modules in the lib*.a files where compiled with -fPIC or not (and whether that matters). Also: be careful to be sure that if the lib*.a files contain C++ code that both where built with the same version of the same C++ compiler. -- Robert Heller -- 978-544-6933 Deepwoods Software -- Linux Installation and Administration http://www.deepsoft.com/ -- Web Hosting, with CGI and Database [EMAIL PROTECTED] -- Contract Programming: C/C++, Tcl/Tk _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus