LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2010, 02:05 PM   #1
catallergy
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
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.
 
Old 03-16-2010, 10:48 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Static libraries vs shared Libraries catallergy Linux - Newbie 2 03-16-2010 02:30 PM
Forcing static linking of shared libraries raghu_rao Linux - Newbie 8 01-14-2009 08:34 AM
Static variable sharing in shared libraries ristiisa Programming 13 10-20-2006 10:08 AM
compiling with shared and static libraries jinksys Programming 1 11-22-2003 05:54 AM
gaim trying to link static and shared libraries rose_bud4201 Linux - Software 0 09-28-2003 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration