[Tutor] embedding python in a C app on a linux box...

Jason Child jasonchild at cnsp.com
Tue Dec 7 19:26:31 CET 2004


Ok, so I have a decent grasp of python and have coded quite a few scripts. I
must say that the language rocks. I would like to embed python into a C app
to provide some scripting support. It would seem that my problem lies with
not understanding the environment (linux) well enough. First off, I must
include the Python.h header escplicitly (via #include
"/usr/include/python2.3/Python.h"). How do I add the correct dir to the
search path for the <> format? Second, when I call Py_Initialize() I get:

/tmp/ccXZxNHZ.o(.text+0x11): In function `main':
: undefined reference to `Py_Initialize'
collect2: ld returned 1 exit status

Now, I think it is because the linker isnt finding the right lib to attach.
Is there a switch to use for gcc for make it? -L /path/to/libs perhaps?

Any and all advice/help is welcome.

flames >/dev/null

Jason Christopher Child

Computer Network Services Professionals
Tech Support
505-986-1669
1-877-321-9165
jasonchild at cnsp.com

VOZ Online
VOIP Install Tech
505-428-7500
1-877-428-7550



More information about the Tutor mailing list