Possible duplicate:Can I mix libraries of static and shared objects during layout?
I want to compile my application statically linking only the boost_system library. Others (glibc, etc.) Must be linked dynamically. How can i do this?
My command to compile dynamically:
g++ -o newserver server.cpp ... -lboost_system -std=c++0x
The command to compile statically is:
g++ -static -o newserver server.cpp ... -pthread -lboost_system -std=c++0x
But this command links everything statically! And the weight of the 2mb application is more!
Can you advise me which command to compile statically, only boost lib?
Thank!
-lboost_system -Wl,-Bstatic -lboost_system -Wl,-Bdynamic. -Wl , .
-lboost_system
-Wl,-Bstatic -lboost_system -Wl,-Bdynamic
-Wl
. -Bstatic -Bdynamic , , . , , , . - : , , -L -L general .
-Bstatic
-Bdynamic
-L
, Boost, , , .so. g++ ( -Bstatic -Bdynamic), . , , , , . , , .
.so