problem compiling extensions with mingw

E

eliben

Hello,
I'm trying to compile the minimal example from
http://en.wikibooks.org/wiki/Python_Programming/Extending_with_C with
MinGW (latest version) and Python 2.5 (latest ActiveState binary
install). When running the setup file, the following happens:

running build
running build_ext
building 'hello' extension
writing build\temp.win32-2.5\Release\hello.def
d:\mingw\bin\gcc.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\hellomo
dule.o build\temp.win32-2.5\Release\hello.def -LC:\Python25\libs -LC:
\Python25\P
Cbuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\hello.pyd
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x3e):
undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x46):
undefined
reference to `_imp___Py_NoneStruct'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

What's more, compiling the same extension with Visual Studio 2005
(without using distutils) works fine, the extension is loaded and ran
successfully from Python. Any ideas about this error ?

Eli
 
E

eliben

Hello,
I'm trying to compile the minimal example fromhttp://en.wikibooks.org/wiki/Python_Programming/Extending_with_Cwith
MinGW (latest version) and Python 2.5 (latest ActiveState binary
install). When running the setup file, the following happens:

running build
running build_ext
building 'hello' extension
writing build\temp.win32-2.5\Release\hello.def
d:\mingw\bin\gcc.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\hellomo
dule.o build\temp.win32-2.5\Release\hello.def -LC:\Python25\libs -LC:
\Python25\P
Cbuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\hello.pyd
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x3e):
undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x46):
undefined
reference to `_imp___Py_NoneStruct'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

What's more, compiling the same extension with Visual Studio 2005
(without using distutils) works fine, the extension is loaded and ran
successfully from Python. Any ideas about this error ?

Eli

Problem solved:
http://eli.thegreenplace.net/2008/06/28/compiling-python-extensions-with-distutils-and-mingw/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top