LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-24-2008, 03:14 PM   #1
qcp
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
gcc link shared library against another shared library


Hi all,

I have a shared library A which uses shared library B, and an application P which relies on A.

I don't want to link P against A and B, but to link P against A only, and A against B (and somehow hide B to P)

How can I do ?

The shared libraries are generated with 'g++ -shared...'

Thanks for your answers
 
Old 07-25-2008, 11:15 AM   #2
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
You have to compile your shared library A first and install to a location contained in your path (/usr/local/lib for example). From that point on build your application using shared library A. Your application doesn't need to know that one of it's libraries uses other libraries as well.

I'm not sure, but I think that 'ldd' will reveal anyway all dependencies, so library B might show up on the list as well.

Is this needed for some workaround due to licensing issues, or is the client not supposed to know that parts of the code are using some external code?

Linux Archive

Last edited by FranDango; 09-20-2008 at 06:22 AM.
 
  


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
list library function of a shared library .so powah Linux - General 7 10-25-2011 04:47 AM
Link shared library in Kdevelop neikinfology Linux - Software 0 07-12-2007 03:35 AM
LINUX - linking archive (static library) with shared (dynamic) library gurkama Programming 5 03-04-2007 11:11 PM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
gcc 3.3.2, shared library luzi82 Debian 2 12-21-2003 09:35 AM


All times are GMT -5. The time now is 01:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration