[Python-Dev] SUCCESS! 2.4 extensions w/mingw (was Re: Switching to VC.NET 2003)

Phillip J. Eby pje at telecommunity.com
Sat Jan 3 23:49:46 EST 2004

(and there was much rejoicing...)

At 10:57 PM 1/3/04 -0500, Phillip J. Eby wrote:
>At 05:43 PM 12/29/03 +0100, Martin v. Loewis wrote:
>>Sure: Please try my installer at
>I just had a chance to try this out.  One problem: pyconfig.h is missing 
>from the installation.
>I copied over my pyconfig.h from Python 2.2, and was able to compile all 
>my target extensions using the distutils 'mingw32' compiler 
>selection.  However, they crash the interpreter immediately upon import.

But, they work now that I'm using the 2.4 pyconfig.h, copied and pasted 
from viewcvs.  :)  I didn't realize at first that it lived in 'PC' rather 
than 'Include' or 'PCBuild'.

>>It also does not include msvcr71.lib - I have no clue how you would
>>get a copy of that. But then, somehow, msvcrt40.lib (or is it
>>msvcrt40.a) must have gotten into mingw32 also.
>I'm guessing that this is related to the coredumps.  I probably need to 
>update my cygwin installation.  Note that one doesn't explicitly link the 
>msvcrt40 with earlier Pythons, so finding out how to change it to the 71 
>version is going to be...  interesting.  Will let you know what I come up with.

As it turns out, it was unnecessary to do anything special, once I had the 
right pyconfig.h.  I just used my normal setup.py, after upgrading to all 
the latest gcc/mingw/libtool/automake/etc. packages of my cygwin 
installation.  I was able to build kjbuckets (Aaron Watters' data structure 
library, used by gadfly), an older version of ZODB 4's C '_persistence' 
support module, and the Pyrex-generated C speedups code for 
PyProtocols.  All my tests for these and a handful of other modules 
passed.  It looks like everything's cool for building 2.4 extensions with 

My only suggestion at this point would be to add 'pyconfig.h' to be 
installed in Python24/include.  It'd be nice to throw in the 
libs/libpython24.a file, too, but it's big (603K) and I guess everybody 
who's been using mingw to this point either knows the procedure for making 
it by heart, or at least has a bookmark to one of the webpages that 
explains how to do it.  (Such as http://sebsauvage.net/python/mingw.html )

More information about the Python-Dev mailing list