473,231 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Re: problem compiling extensions with mingw

On Jun 27, 3:10 pm, eliben <eli...@gmail.comwrote:
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+0x3 e):
undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x4 6):
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...ils-and-mingw/
Jun 28 '08 #1
2 3562
On Jun 28, 3:41 pm, eliben <eli...@gmail.comwrote:
On Jun 27, 3:10 pm, eliben <eli...@gmail.comwrote:
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+0x3 e):
undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x4 6):
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...n-extensions-w...
libpython2?.a is now *supplied* with the official CPython distribution
from www.python.org.

The procedure that you followed is described in the manual:
http://docs.python.org/inst/tweak-fl...00000000000000

Cheers,
John
Jun 28 '08 #2
On Jun 28, 8:20 am, John Machin <sjmac...@lexicon.netwrote:
On Jun 28, 3:41 pm, eliben <eli...@gmail.comwrote:
On Jun 27, 3:10 pm, eliben <eli...@gmail.comwrote:
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+0x3 e):
undefined
reference to `_imp___Py_NoneStruct'
build\temp.win32-2.5\Release\hellomodule.o:hellomodule.c:(.text+0x4 6):
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...n-extensions-w...

libpython2?.a is now *supplied* with the official CPython distribution
fromwww.python.org.
I'm using ActiveState's distribution, because I was told that it comes
with more precompiled win32 goodies out of the box.
The procedure that you followed is described in the manual:http://docs.python.org/inst/tweak-fl...62200000000000...
Thanks, I didn't notice it :-)

Eli

Jun 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
1
by: A. B., Khalid | last post by:
Hello all. After a search on Google it would seem that the users of Mingw have not had good results in compiling the python sources natively. See at least: ...
0
by: A. B., Khalid | last post by:
Hello all. After the effort of getting most of Python 2.3.4 Final compiled in MinGW (see: http://mail.python.org/pipermail/python-list/2004-June/225967.html, and get the patch and read more...
30
by: Jive | last post by:
Can someone explain to me why Python 2.4 on MS Windows has these backward compatibility problems? What am I missing? Why won't extensions compiled to run with 2.3 also work with 2.4? Why does it...
0
by: peter | last post by:
Hello all, I would like to debug my python libraries, written in c++, with GDB (gnu debugger) I'm using the mingw compiler in a windows environment. As development environment I use eclipse...
26
by: Kevin D. Smith | last post by:
I've written a simple Python extension for UNIX, but I need to get it working on Windows now. I'm having some difficulties figuring out how to do this. I've seen web pages that say that MS Visual...
6
by: JW | last post by:
I have a lousy little Python extension, generated with the generous help of Pyrex. In Linux, things are simple. I compile the extension, link it against some C stuff, and *poof*! everything...
8
by: rays | last post by:
Hi, I am trying to port a C++ program which is supposed to be standards compliant. It works fine on Linux with GCC (4.x). But as I try to compile it on Windows, all hell breaks loose. I have been...
81
by: =?utf-8?B?4piG4piG4piG4piG4piGIFPDvCBLZWl0aCBDaGFr | last post by:
Installed this compiler on Vista; a simple "hello world" after compiled and run would pop-up a window "source file not compiled" I've seen this question asked a few times on Internet groups and...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.