This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: finding the library in which symbol is defined.
Where are the "Py*" symbols defined on my system?
Good question, and for me a perplexing one.
I build python 2.3.3, so I have its source directory tree. No *.so
files are created in the process of building and installing it. I
searched through the entire directory tree for these symbols and the
only place I find them is either in various *.o files and python, the
actual executable.
The only idea I've come up with considering this fact is making a
libpython.so link to python and see what happens. Expect the linker to
crash. So I have not tried...
The most recent libpython*.so file I've got on my system is
libpython2.2.so. I've tried this and it resolves most, not all,
problems but I do not mix versions unless explitely instructed to.
This particular issue is something that I expect I need to get from
either python or boost.python fokes. So far no joy.
The only question I have of you is:
Is it normal that my simple cpptest exe has an appetite for the "Py*"
symbols, even though they are required by a used shared library and a
shared library which it uses?
I'd like to dramatically simply what I'm creating. Now it has an
abstract interface for some 40 classes, plus a pesty class factory
paridiagn because this was necessary for windows. As of boost::python
v2, python doesn't require it. The jury on gcc is still out.
The requested output of objdump is attached.
Ian Lance Taylor wrote:
Jeffrey Holle <jeff.holle@verizon.net> writes:
Examples of the specific linker errors that are troubling me:
/usr/local/lib/libboost_python.so.1.31.0: undefined reference to
`PySequence_DelSlice'
/usr/local/lib/libboost_python.so.1.31.0: undefined reference to
`PyNumber_InPlaceXor'
../cppTest/libUMLModel.so: undefined reference to `PyInt_FromLong'
Where are those symbols defined on your system?
If they are defined in, e.g, /usr/lib/libpython.so.*, have you tried
adding -lpython to your link command?
What is the output of
objdump -p /usr/local/lib/libboost_python.so.1.31.0
?
Ian
/usr/local/lib/libboost_python.so.1.31.0: file format elf32-i386
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
filesz 0x000450e6 memsz 0x000450e6 flags r-x
LOAD off 0x00045100 vaddr 0x00046100 paddr 0x00046100 align 2**12
filesz 0x000014c0 memsz 0x00001890 flags rw-
DYNAMIC off 0x00045b44 vaddr 0x00046b44 paddr 0x00046b44 align 2**2
filesz 0x000000e0 memsz 0x000000e0 flags rw-
EH_FRAME off 0x0003d274 vaddr 0x0003d274 paddr 0x0003d274 align 2**2
filesz 0x00001014 memsz 0x00001014 flags r--
Dynamic Section:
NEEDED libstdc++.so.5
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
SONAME libboost_python.so.1.31.0
INIT 0x1b92c
FINI 0x3be70
HASH 0xb4
STRTAB 0x578c
SYMTAB 0x189c
STRSZ 0x13dd8
SYMENT 0x10
PLTGOT 0x46c5c
PLTRELSZ 0xd88
PLTREL 0x11
JMPREL 0x1aba4
REL 0x19dc4
RELSZ 0xde0
RELENT 0x8
VERNEED 0x19d44
VERNEEDNUM 0x3
VERSYM 0x19564
RELCOUNT 0x51
Version References:
required from libgcc_s.so.1:
0x0b792650 0x00 06 GCC_3.0
required from libc.so.6:
0x09691f73 0x00 05 GLIBC_2.1.3
0x0d696910 0x00 04 GLIBC_2.0
required from libstdc++.so.5:
0x056bafd2 0x00 03 CXXABI_1.2
0x081a2972 0x00 02 GLIBCPP_3.2