help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

runtime symbol lookup error


From: markolah
Subject: runtime symbol lookup error
Date: 15 Feb 2005 02:10:58 -0800
User-agent: G2/0.2

Hi,

I have a very strange runtime symbol look-up error.  While I suppose
this may be slightly off topic, I'm not sure of a more relevent
newsgroup, and I trust the people here have delt with most every
linking problem possible.

I have a c++ shared library that is having problems looking up a symbol
at runtime.  The problem is, the symbol exists, it is correctly linked
and the rpath is set correctly.  Hopefully someone here can help.

One note, the library is loaded by ruby as a module, however i'm
certain ruby is not the problem, as it loads the library fine.  Only
within the library does the symbol lookup problem occur.

Here's the research I've done so far:

$ valgrind --tool=memcheck ruby <program>
...
/usr/bin/ruby: symbol lookup error:
/home/mjo/tumble/branches/mjo-experimental/lib/ruby/NavierStokes.so:
undefined symbol: PetscInitialize
...

$ nm NavierStokes.so | c++filt | grep PetscInitialize
         U PetscInitialize(int*, char***, char const*, char const*)

$ nm /usr/petsc/petsc-2.2.1/lib/libg_c++/linux-gnu/libpetsc.so |
c++filt | grep PetscInitialize
00098eee T PetscInitialize(int*, char***, char const*, char const*)

$ readelf -d NavierStokes.so
....
0x00000001 (NEEDED)                     Shared library: [libpetsc.so]
....
0x0000000f (RPATH)                      Library rpath:
[/usr/petsc/petsc-2.2.1/lib/libg_c++/linux-gnu:/home/mjo/tumble/trunk/lib/tumble]
0x0000001d (RUNPATH)                    Library runpath:
[/usr/petsc/petsc-2.2.1/lib/libg_c++/linux-gnu:/home/mjo/tumble/trunk/lib/tumble]
....

I have also tried setting LD_RUN_PATH and recompiled, and I have set
LD_LIBRARY_PATH, and added the path to /etc/ld.so.conf and regnerated
/etc/ld.so.cache.  None of these were any help.

Also, my user has read and execute permissions for libpetsc.so, so it's
not a permissions problem.

Too make the matter more interesting, I have an executable that is
dynamically linked to the same Petsc library and it works fine!  It has
simmilar output from 'nm' and 'readelf'.

My system is gentoo linux:
gcc-3.4.3.20050110
binutils-2.15.92.0.2-r2

I have the same exact problem on my redhat 9.0 box:
gcc-3.2.2 20030222
binutils-2.13.90.0.18 20030206

Any help would be much appriciated.

-Mark Olah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]