[Pythonmac-SIG] locating Python.h
Feat
jf at ai.univ-paris8.fr
Wed May 14 17:49:40 CEST 2008
At 10:53 +0100 2008/04/05, Matthias Baas wrote:
>Just for the record, the distutils have a function that returns the include path:
> >>>import distutils.sysconfig
> >>>distutils.sysconfig.get_python_inc()
>
>So if you really need to know the include path for some reason, you should use this function as it is platform independent. But as was said above, when compiling an extension module adding this path manually is not required.
Thanks: my next step also involves including Python.h, as documented in section 5.1 Very High Level Embedding :
[http://docs.python.org/ext/high-level-embedding.html]
The problem is this header file does not define the required symbols for the C code example at the above link :
collect2: ld returned 1 exit status
/Developer/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld:
Undefined symbols:
_Py_Initialize
_Py_Finalize
_PyRun_SimpleString
I've unsuccessfully tried all of the Python.h files I could find in my tree...
Does anybody know how to link such a simple program properly?
Or merely give me a clue about what I'm doing wrong?
More information about the Pythonmac-SIG
mailing list