I have a third-party library which consists mainly of a large number of static (.a
) library files. I can compile this into a single .a
library file, but I really need it to be a single .so
shared library file.
Is there any way to convert a static .a
file into a shared .so
file? Or more generally is there a good way to combine a huge number of static .a
files with a few .o
object files into a single .so
file?
Static libraries take longer to execute, because loading into the memory happens every time while executing. While Shared libraries are faster because shared library code is already in the memory. In Static library no compatibility issue has been observed.
Yes for instance when you call windows functions from within your static lib they are normally from some dynamic library so there should be no difference.
Shared libraries are added during linking process when executable file and libraries are added to the memory. Static libraries are much bigger in size, because external programs are built in the executable file.
Does this (with appropriate -L's of course)
gcc -shared -o megalib.so foo.o bar.o -la_static_lib -lb_static_lib
Not do it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With