Alexandre Fayolle wrote:
I'm trying to build an extension module on windows using the --compiler=mingw32 option to the build command, but I get the following error :
running build_ext building 'logilab.xmldiff.maplookup' extension creating build\temp.win32-2.1 creating build\temp.win32-2.1\Release C:\CYGWIN\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON21\Include -c logilab/xmldiff/extensions/maplookup.c -o build\temp.win32-2.1\Release\maplookup.o writing build\temp.win32-2.1\Release\maplookup.def C:\CYGWIN\BIN\gcc.exe -mno-cygwin -mdll -static -s build\temp.win32-2.1\Release\ maplookup.o build\temp.win32-2.1\Release\maplookup.def -LC:\PYTHON21\libs -lpython21 -o build\lib.win32-2.1\logilab\xmldiff\maplookup.pyd build\temp.win32-2.1\Release\maplookup.o(.text+0xb2):maplookup.c: undefined reference to `_imp___Py_NoneStruct' build\temp.win32-2.1\Release\maplookup.o(.text+0xb9):maplookup.c: undefined reference to `_imp___Py_NoneStruct' build\temp.win32-2.1\Release\maplookup.o(.text+0x150):maplookup.c: undefined reference to `_imp___Py_NoneStruct' build\temp.win32-2.1\Release\maplookup.o(.text+0x157):maplookup.c: undefined reference to `_imp___Py_NoneStruct' collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1
I'm running python 2.1 on Win98, with gcc 2.95.3-5 and ld 2.11.90.
nm on maplookup.o told me the following $ nm //C/temp/DistUtils/build/temp.win32-2.1/Release/maplookup.o | grep None U __imp___Py_NoneStruct
(notice the double underscore at the beginning of the symbole, whereas the error message has only one underscore)
The only symbols I could find in python21.lib having something to do with None are the following :
$ nm python21.lib | grep None mp.win32-2.1/Release 00000000 T _PyErr_SetNone 00000000 I __imp__PyErr_SetNone
Does anyone have an idea about what's going on ?
gcc needs its own libraries. See at http://python.sourceforge.net/devel-docs/inst/non-ms-compilers.html how to build these libraries.
kind regards Rene Liebscher