embedding Python in C

toto totoNOSPAM at toto.fr
Tue Sep 24 11:52:06 CEST 2002


Hello,

I try to use a simple programme to try to run Python code from C by
calling the PyRun_SimpleString API function. But I have the following
problem when I compile the programme C :

------------------------------------------------
bash-2.04$ make -f usermod.mak
gcc embed-usermod.o
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a -L/usr/lib
-L/usr/X11R6/lib -lgdbm -ltk8.3 -ltcl8.3 -lX11 -lm -ldl -g
-export-dynamic  -o embed-usermod
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a(posixmodule.o):
In function `posix_tmpnam':
/usr/src/redhat/BUILD/Python-2.1.1/./Modules/posixmodule.c:4212: the use
of `tmpnam_r' is dangerous, better use `mkstemp'
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a(posixmodule.o):
In function `posix_tempnam':
/usr/src/redhat/BUILD/Python-2.1.1/./Modules/posixmodule.c:4168: the use
of `tempnam' is dangerous, better use `mkstemp'
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a(thread.o):
In function `PyThread_start_new_thread':
/usr/src/redhat/BUILD/Python-2.1.1/Python/thread_pthread.h:135:
undefined reference to `pthread_create'
/usr/src/redhat/BUILD/Python-2.1.1/Python/thread_pthread.h:159:
undefined reference to `pthread_detach'
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a(posixmodule.o):
In function `posix_openpty':
/usr/src/redhat/BUILD/Python-2.1.1/./Modules/posixmodule.c:1754:
undefined reference to `openpty'
/local/edf-python-2.1.1/lib/python2.1/config/libpython2.1.a(posixmodule.o):
In function `posix_forkpty':
/usr/src/redhat/BUILD/Python-2.1.1/./Modules/posixmodule.c:1785:
undefined reference to `forkpty'
collect2: ld returned 1 exit status
make: *** [embed-usermod] Erreur 1
------------------------------------------------

If some of you can give me some ideas of this problem ? Thank you  very
much.

Yang




More information about the Python-list mailing list