[C++-sig] undefined symbol problem help
Grant
grant.tang at gmail.com
Thu May 1 01:27:46 CEST 2008
I need wrap a project into Python. All C++ classes are built as a shared
library libGORGON.so. The boost.python wrapper file is built as
libpyGORGON.so. But when I try to import libpyGORGON in Python prompt. I got
error:
Python 2.4.4 (#1, Oct 23 2006, 13:58:18) [GCC 4.1.1 20061011 (Red Hat
4.1.1-30)] on linux2 Type "help", "copyright", "credits" or "license" for
more information.
>>> import libpyGORGON.so
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: /data2/Gorgon/lib/libGORGON.so: undefined symbol:
_ZTIN8wustl_mm13Visualization8RendererE
>>>
I already set the LD_LIBRARY_PATH and PYTHONPATH to /data2/Gorgon/lib.
I use ldd to check the libpyGORGON.so:
libGORGON.so => /data2/Gorgon/lib/libGORGON.so (0x00002aaaaadf0000)
libboost_python.so.2 => /usr/lib64/libboost_python.so.2
(0x00002aaaab157000)
libpython2.4.so.1.0 => /usr/lib64/libpython2.4.so.1.0
(0x00002aaaab395000)
libGL.so.1 => /usr/lib64/libGL.so.1 (0x00002aaaab6ca000)
libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00002aaaab88d000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaabb0d000)
libm.so.6 => /lib64/libm.so.6 (0x00002aaaabe0e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaac091000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaac29e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaac5ed000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaac807000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002aaaaca0b000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x00002aaaacc0f000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x00002aaaace20000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00002aaaad12c000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00002aaaad32e000)
And also I search the symbol in libGORGON.so:
$ nm libGORGON.so | grep _ZTIN8wustl_mm13Visualization8RendererE
It actually finds the symbol. I am confused. Anybody help me out?
By the way, I did not use bjam. I use cmake to create makefile for me.
Thanks,
Grant
More information about the Cplusplus-sig
mailing list