SWIG /Python problem

Andrew Gregory andrew.gregory at npl.co.uk
Thu Nov 7 10:52:44 EST 2002


I've just upgraded from SWIG 1.3.11 to 1.3.16. I tested it by
re-building an already working Python DLL (using Borland 5.5 C/C++
compiler).
On importing it I got the error message: _PyImport_FixupExtension

Examining it I found that an extra underscore had appeared in the
wrapper file. Previously (1.3.11):

/* -------- TYPES TABLE (END) -------- */

#define SWIG_init    initpysimple

#define SWIG_name    "pysimple"


Now (1.3.16):
/* -------- TYPES TABLE (END) -------- */


/*-----------------------------------------------
              @(target):= _pysimple.so
  ------------------------------------------------*/
#define SWIG_init    init_pysimple

#define SWIG_name    "_pysimple"


The .def file now looks like this

LIBRARY PYSIMPLE
EXPORTS
  initpysimple = _init_pysimple
DESCRIPTION 'Simple Python DLL'
EXETYPE WINDOWS
CODE MOVEABLE
DATA MOVEABLE MULTIPLE
HEAPSIZE 1024



How do I fix this?



Andrew.



More information about the Python-list mailing list