Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-15-2006, 02:08 PM   #1
Registered: Jun 2004
Location: Hillsboro, Oregon, USA
Distribution: Mint
Posts: 41

Rep: Reputation: 15
Shared object library that uses another shared object library

I have a project I'm working on that makes a shared object library (.so) containing its code that I am using in another project. I would like to be able to split up the first project into several shared object files so that I don't have to bring all of it into another project when I only need one or two classes from it.

The problem I'm running into now is that some of the classes in one shared library now requires code from the other shared library. Each shared library builds and installs just fine. My other project needs both shared libraries. When I go to build the project, make tells me that there are undefined references to things in the smaller shared object that are being called in the bigger shared object.

I'm not sure where the problem is, since I've specified both libraries in the LIBS variable in the makefile. Is there a way to have a shared object library that uses code in another shared object library?
Old 02-15-2006, 10:00 PM   #2
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
it can be as simple as order
the linker works from left to right
so when it encounters unresolved symbols they must be in something to the right not left in the command


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
error while loading shared libraries: cannot open shared object file: Franziss Linux - Newbie 10 06-28-2010 05:47 AM
unable to step through function in shared object library using gdb markhod Programming 2 01-03-2009 02:00 AM
error while loading shared libraries: cannot open shared object file putquery8581 Linux - Software 1 10-01-2004 07:03 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
shared object library won't load (libstdc++) sleepylight Linux - General 4 04-27-2004 04:24 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:41 AM.

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