extension called from embedded code

Gordon McMillan gmcm at hypernet.com
Tue Jun 15 16:17:10 CEST 1999


Henk Jansen writes:

> Trying to get the most out off the C++/Python team I run into
> problems when I try to load extension modules (written in C, like
> kjbuckets or ranlib) from Python code that is embedded in a C++
> application. The API I use is 'PyRun_SimpleString("import
> kjbuckets\n");' and causes unresolved symbol error messages from the
> Python interpreter (e.g. PyType_Type for kjbucketsmodule.so and
> PyExc_RuntimeError for ranlib.so). Loading these modules when Python
> is in control goes fine. Has anyone any idea how to do this?

This has something (platform / compiler / linker specific) 
to do with the way you've built your app. For some reason the symbols 
in your embedded Python are not getting exposed to the dynamic 
linker. Perhaps if you post the relevant snippets from your Makefile, 
someone with experience on that platform (compiler...) can help.

- Gordon




More information about the Python-list mailing list