473,382 Members | 1,329 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,382 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 3568
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.