[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make shared library( .so )
From: |
Paul Pluzhnikov |
Subject: |
Re: make shared library( .so ) |
Date: |
Sat, 03 Feb 2007 06:54:43 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
ravindra.csd@gmail.com 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,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.