473,625 Members | 2,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: problem compiling extensions with mingw

On Jun 27, 3:10 pm, eliben <eli...@gmail.c omwrote:
Hello,
I'm trying to compile the minimal example fromhttp://en.wikibooks.or g/wiki/Python_Programm ing/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.win3 2-2.5\Release\hel lo.def
d:\mingw\bin\gc c.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\hel lomo
dule.o build\temp.win3 2-2.5\Release\hel lo.def -LC:\Python25\li bs -LC:
\Python25\P
Cbuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\hello.pyd
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x3e):
undefined
reference to `_imp___Py_None Struct'
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x46):
undefined
reference to `_imp___Py_None Struct'
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 3591
On Jun 28, 3:41 pm, eliben <eli...@gmail.c omwrote:
On Jun 27, 3:10 pm, eliben <eli...@gmail.c omwrote:
Hello,
I'm trying to compile the minimal example fromhttp://en.wikibooks.or g/wiki/Python_Programm ing/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.win3 2-2.5\Release\hel lo.def
d:\mingw\bin\gc c.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\hel lomo
dule.o build\temp.win3 2-2.5\Release\hel lo.def -LC:\Python25\li bs -LC:
\Python25\P
Cbuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\hello.pyd
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x3e):
undefined
reference to `_imp___Py_None Struct'
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x46):
undefined
reference to `_imp___Py_None Struct'
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...@lexic on.netwrote:
On Jun 28, 3:41 pm, eliben <eli...@gmail.c omwrote:
On Jun 27, 3:10 pm, eliben <eli...@gmail.c omwrote:
Hello,
I'm trying to compile the minimal example fromhttp://en.wikibooks.or g/wiki/Python_Programm ing/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.win3 2-2.5\Release\hel lo.def
d:\mingw\bin\gc c.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\hel lomo
dule.o build\temp.win3 2-2.5\Release\hel lo.def -LC:\Python25\li bs -LC:
\Python25\P
Cbuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\hello.pyd
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x3e):
undefined
reference to `_imp___Py_None Struct'
build\temp.win3 2-2.5\Release\hel lomodule.o:hell omodule.c:(.tex t+0x46):
undefined
reference to `_imp___Py_None Struct'
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
4924
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 the occurrences of FilterType that may be relevant: ------- C:\sketch\sketch-0.7.12\Filter\filterobj.c: 949: PyTypeObject FilterType = {
1
2529
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: http://uucode.com/texts/python-mingw/python-mingw.html Having said that, kindly allow me to report that Mingw32 can
0
1703
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 about it here: http://jove.prohosting.com/iwave/ipython/pyMinGW.html), allow me to report that it is now also possible to compile and build most of python24a3 in MinGW as well.
30
2016
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 matter whether a component was compiled with VC++ 6.0 or 7.1? I've been using MS stuff for 6 years. Before I started using Python, I don't remember ever having a program tell me I had to use an OLDER version of something to make the program...
0
2267
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 with the CDT plugin. This plugin also has a nice GUI frontend for the GDB. I've already tried several setups, no setup seemed to work.
26
2140
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 Studio is required, and other that say that's not true, that MinGW will work. Then there is Mike Fletcher's web page (http://www.vrplumber.com/programming/mstoolkit/) that describes in detail how to build extensions, but most of the links to...
6
2227
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 works. My employer wants me to create a Windows version of my extension that works with the vanilla Python 2.5 from python.org. My employment contract states that I won't be required to run Windows, and I desperately want to honor that clause....
8
2291
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 struggling with several free (as beer) compilers on windows, but none of them does the job. I am not sure how much of the blame goes to our code and how much to the compilers. By the way the platform is Windows XP and all the softwares mentioned...
81
11721
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 noone seems to have figure it out. What is going on?
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.