Hello!
I'm using SIP library (pjsip) that is compiled into multiple static libraries. It doesn't have an option to compile it as shared libraries so they are compiles as static libraries by default. I have some small wrapper code that is calling all needed functions in the static libraries (from C++ wrapper as extern "C" some_pjsip_function_name() ). There is no main() function in it. Now, I would like to build this wrapper code as shared library. I expected that all needed symbols from static libraries will be linked into shared library, but this is not the case. The shared library generated is too small (40 K or so).
My steps were:
Code:
g++ -c -fPIC -I "../pjsip/include/" -I "../pjlib/include" -I "../pjlib-util/include" -I "../pjmedia/include" -I "../pjnath/include" -shared -o pjsipDll.o pjsipDll.cpp
g++ -shared -Wl -o libpjsipDll.so.1.0.1 pjsipDll.o -L. -lpjsua-i686-pc-linux-gnu -lpjsip-ua-i686-pc-linux-gnu -lpjsip-simple-i686-pc-linux-gnu -lpjsip-i686-pc-linux-gnu -lpjmedia-codec-i686-pc-linux-gnu -lpjmedia-i686-pc-linux-gnu -lpjnath-i686-pc-linux-gnu -lpjlib-util-i686-pc-linux-gnu -lresample-i686-pc-linux-gnu -lmilenage-i686-pc-linux-gnu -lsrtp-i686-pc-linux-gnu -lgsmcodec-i686-pc-linux-gnu -lspeex-i686-pc-linux-gnu -lilbccodec-i686-pc-linux-gnu -lportaudio-i686-pc-linux-gnu -lpj-i686-pc-linux-gnu -lm -lnsl -lrt -lpthread -lssl -lcrypto
I get:
-rwxr-xr-x 1 foo foo 38238 2008-05-15 14:24 libpjsipDll.so.1.0.1
Am I missing something? Is there some other way to do what I want?
Regards,