Python Dynamic Loading (extending Python for SWIG)

Paul McRae mcraep at nortelnetworks.com
Fri Oct 5 15:11:33 EDT 2001


I have gotten to the point on QNX 6.1 (x86) using Python 2.0 so that I
can import my shared library created from SWIG, but I get the following
unresolved symbols:

>>> import my_shared_lib
unknown symbol: _Py_NoneStruct
unknown symbol: PyString_Type
unknown symbol: PyExc_TypeError
unknown symbol: PyType_Type
unknown symbol: PyExc_NameError
unknown symbol: PyInt_FromLong
unknown symbol: PyObject_GetAttr
unknown symbol: PyDict_SetItemString
unknown symbol: PyErr_SetString
unknown symbol: Py_InitModule4
unknown symbol: PyString_AsString
unknown symbol: PyString_FromString
unknown symbol: PyModule_GetDict
unknown symbol: PyString_InternFromString
unknown symbol: PyFloat_FromDouble
unknown symbol: PyArg_ParseTuple

Is there a SWIG library I need to add to the link stage?  I thought
these would be defined inside of the Python interpreter.  I am using the
following compilation commands:

  qcc -c -g -fpic -I/usr/include/python2.0 -I/usr/lib/python2.0/config
my_shared_lib.c
  qcc -shared -g -o my_shared_libmodule.so my_shared_lib.o
my_shared_lib_functions.o


Paul McRae wrote:
> 
> Has anyone gotten importing a shared library into Python to work?  I
> have ported SWIG to QNX and would like to add the functions in my shared
> lib to Python using the 'import' statement.  I have also tried to
> compile my own Python intepreter with the functions embedded with no
> success.
> 
> Any help would be appreciated!
> 
> --Paul
> -----------------------------------------------------------------
> Paul McRae, Nortel Networks Optical, QNX Migration, TD22,
> Work:  613-765-8872, Home:  613-822-8211,  Cell: 613-863-0708

-- 
--Paul
-----------------------------------------------------------------
Paul McRae, Nortel Networks Optical, QNX Migration, TD22, 
Work:  613-765-8872, Home:  613-822-8211,  Cell: 613-863-0708



More information about the Python-list mailing list