Embedding C into Python

Jeff Shipman - UC jeff at nmt.edu
Sat Oct 23 18:42:45 EDT 1999


I am trying to embed a C module into my python code. I've coded the
module and I think everything's ok, but when I use 'gcc blahmodule.c', I
get the following error:

/tmp/ccype0NL.o: In function `blah_add':
/tmp/ccype0NL.o(.text+0x24): undefined reference to `PyArg_ParseTuple'
/tmp/ccype0NL.o(.text+0x4f): undefined reference to `Py_BuildValue'
/tmp/ccype0NL.o: In function `initblah':
/tmp/ccype0NL.o(.text+0x7b): undefined reference to `Py_InitModule4'
collect2: ld returned 1 exit status

I'm including Python.h so I don't know why this is happening. Also, when
this compiles, will this allow me to say 'import blahmodule' like
I want? Or is there more that has to be done in order to put a C module
into Python?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Shipman (jeff at nmt.edu)
User Consultant - New Mexico Tech Computer Center
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







More information about the Python-list mailing list