Help: "undefined reference to `PyArg_ParseTuple'" when execising 'Extending Python with C or C++ '

Matthias Kramm matthias.kramm at stud.tu-muenchen.de
Mon Apr 7 04:29:50 EDT 2003


On Sun, Apr 06, 2003 at 09:45:28PM +0800, Lu Jian Xiong wrote:
> [root at localhost user0]# gcc -I /usr/include/python2.2/ -L /usr/lib/python2.2/c
> onfig/ -l python2.2 spammodule.c
> /tmp/ccIl3dpq.o: In function `spam_system':
> /tmp/ccIl3dpq.o(.text+0x16): undefined reference to `PyArg_ParseTuple'
> /tmp/ccIl3dpq.o(.text+0x47): undefined reference to `Py_BuildValue'
> collect2: ld returned 1 exit status

Try putting the "-l python2.2" part after "spammodule.c", so that
the above command reads
    gcc -I/usr/include/python2.2/ -L/usr/lib/python2.2/config/ spammodule.c -lpython2.2

Btw. what do you need the "-L/usr/lib/python2.2/config/" for?

Greetings

Matthias






More information about the Python-list mailing list