c++ - Can I build a shared library by linking static libraries? -



c++ - Can I build a shared library by linking static libraries? -

i have bunch of static libraries (*.a), , want build shared library (*.a) link against static libraries (*.a). how can in gcc/g++? thanks!

you can (just extract .o files , link them -shared create .so), whether works, , how works, depends on platform , whether static library compiled position-independent code (pic). on platforms (e.g. x86_64), non-pic code not valid in shared libraries , not work (actually think linker reject create .so). on other platforms, non-pic code work in shared libraries, in-memory re-create of library not sharable between different programs using or different instances of same program, result in huge memory bloat.

c++ c gcc shared-libraries static-libraries

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -