shared lib

Feb 25, 2005 2 Replies

Hi, Assume a module/application is using a shared library. Now if i need to statically link the shared library then i need to make the compiler understand that the .so file should be statically linked. Can someone please let me know as how can we achieve this?



Thanks Uday


.so is not statically linked. .so is "shared object". By default a compiler like gcc tries to link with shared library. If you need to link statically (.a file) use -static option.

-siddharth

You can't, it works differently: the .so file is built to be a shared library (.so = "shared object"). Usually, there is also a statically linkable version of the same library (built from the same sources, but with different build options) by the name of .a . If you link your program statically, the compiler will link against that .a file, not against the .so file.

HTH

Rob

Robert Kaiser email: rkaiser AT sysgo DOT com SYSGO AG http://www.elinos.com Klein-Winternheim / Germany http://www.sysgo.com

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required