shared lib

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

Reply to
Uday Mullangi
Loading thread data ...

.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

Reply to
Siddharth Choudhuri

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
Reply to
Robert Kaiser

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.