-   Programming (
-   -   Linking to Shared Libraries with g++ (

random0 06-15-2006 09:43 PM

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:


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?

random0 06-15-2006 10:12 PM

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

All times are GMT -5. The time now is 04:49 AM.