LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   GCC/G++ with shared and static libraries (https://www.linuxquestions.org/questions/linux-software-2/gcc-g-with-shared-and-static-libraries-795838/)

catallergy 03-16-2010 01:05 PM

GCC/G++ with shared and static libraries
 
Hi

I have a third party static library (libSTATIC.a) that I cannot
recompile into a shared library. I want to create
a shared library (libSHARED.so) that uses the functions in the static
library libSTATIC.a. Is it possible to do this with gcc/g++?
In other words, when linking a C program with gcc/g++ by using the
-shared flag, is it necessary that all libraries invoked anywhere in the program (even low level libraries such as libc for example) be available
as shared libraries as well?

Thanks a lot.

sundialsvcs 03-16-2010 09:48 PM

As far as I am aware, you need the source-code in order to rebuild any library. I am not aware of any direct method (although I could definitely be wrong here...) for converting a static library into a dynamic one, as a binary transformation between the two.


All times are GMT -5. The time now is 07:57 AM.