Py_GetPath() C API in python 3

stalex shao.tu at gmail.com
Thu Dec 11 10:53:58 CET 2008


Hi all,

I want to build a new, requires total control, python interpreter. So
I implement my own version of Py_GetPath(), Py_GetPrefix(),
Py_GetExecPrefix() and Py_GetProgramFullPath(). When compiling, I
always get error messages, for each API function, look like
followings:

/opt/python-3.0/lib/python3.0/config/libpython3.0.a(getpath.o)(.text
+0x211c): In function `Py_GetPath':
./Modules/getpath.c:739: multiple definition of `Py_GetPath'
myApp.o(.text+0x0):/home/alex/workspace/develop/src/myApp.c:11: first
defined here
/usr/bin/ld: Warning: size of symbol `Py_GetPath' changed from 126 in
system.o to 32 in /opt/python-3.0/lib/python3.0/config/libpython3.0.a
(getpath.o)
collect2: ld returned 1 exit status

If I compile my application with python 2.x, everything's just okay
and my application as well. Any ideas on how to get this working for
python 3?



More information about the Python-list mailing list