This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linking a third-party library with my own library
- From: "Rodrigo Dominguez" <roddomi at hotmail dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 8 Mar 2009 14:04:54 -0400
- Subject: Linking a third-party library with my own library
Hi,
I am trying to link a third-party shared object library (libpapi.so) with my
own library .so file. The libpapi.so file lives in a different directory
than my library. I am running the following command:
g++ -shared [other switches] -L/path-to-libpapi [more switches] -lpapi -o
mylibrary.so mylibrary.o
The command executes without errors. However, when I run 'ldd mylibrary.o' I
get:
libpapi.so.3 => not found
I can see that libpapi.so.3 exists under /path-to-libpapi. Needless to say,
when I try to load my library it complains about not being able to find
libpapi.so.3.
What am I missing?
Thank you,
Rodrigo