Linking statically only boost library G++ [duplicate]

view story

http://stackoverflow.com – Possible Duplicate: Can I mix static and shared-object libraries when linking? I want to compile my app, linking statically only boost_system library. Other(glibc and etc) should be linked dynamically. How can i do it? My command to compile dynamically: g++ -o newserver server.cpp ... -lboost_system -std=c++0x Command to compile statically: g++ -static -o newserver server.cpp ... -pthread -lboost_system -std=c++0x But this command link statically all! And app weights 2mb more! Can you advice me what command to compile statically only boost lib? Thanks! (HowTos)