If all I have of a library is a *.a static library. Is there a way I can convert that to *.so dynamically linked library? Maybe using ld?
I'm using SUSE Linux. ELF platform.
If all I have of a library is a *.a static library. Is there a way I can convert that to *.so dynamically linked library? Maybe using ld?
I'm using SUSE Linux. ELF platform.
This command will attempt to do what you want:
gcc -shared -Wl,--whole-archive library.a -o library.so
But if your library wasn't compiled with -fpic
/-fPIC
, which it probably wasn't, it won't work (it might appear to work, but you don't get any of the benefits of shared libraries).