LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-15-2006, 09:43 PM   #1
random0
LQ Newbie
 
Registered: Jun 2006
Location: Gainesville, Fl, USA
Distribution: Debian GNU/Linux
Posts: 18

Rep: Reputation: 0
Linking to Shared Libraries with g++


I'm working on a small project that I compile into a shared library. This project is done with autotools, so I have split major pieces into subdirectories which are put together as libtool libraries and then linked to my final shared library. But, when I link the shared library to my test program, it can access all library functions outside those that were in the libtool libraries. Those linked in libtool libraries return errors such as this when called:

Quote:
test.cpp.text+0x40): undefined reference to `raim::Error::Error(int, char const*)'
collect2: ld returned 1 exit status
How might I go about solving this problem?
 
Old 06-15-2006, 10:12 PM   #2
random0
LQ Newbie
 
Registered: Jun 2006
Location: Gainesville, Fl, USA
Distribution: Debian GNU/Linux
Posts: 18

Original Poster
Rep: Reputation: 0
I've already discovered my solution. All that needed to be done was to add the -static flag when linking the convenience libraries.
 
  


Reply



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
Linking static and shared libraries in the KDevelop Environment tristanm Programming 15 11-27-2006 09:59 PM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 07:47 AM
Shared libraries and linking., devin Programming 3 04-08-2003 03:18 PM
Linking to shared libraries? Griffon26 Programming 1 10-20-2001 05:29 PM
linking with shared libraries kobilevi Programming 0 03-01-2001 10:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:58 PM.

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