Compiling Python Extensions on Win32 with GCC 2.95

Robert Kern kernr at mail.ncifcrf.gov
Tue Aug 10 22:05:41 EDT 1999


With the recent release of GCC 2.95, I have updated my instructions
for compiling Python extensions on Windows 95/98 and NT systems using
free tools.  My previous instructions explained the setup for using
EGCS 1.1.2, an "experimental" version of GCC.  Since EGCS merged into
GCC to make GCC 2.95, the instructions could be updated to use this
newest compiler.

To provide some background, GCC (GNU Compiler Collection) is a GPL'ed,
well, compiler collection that includes front ends for C, C++,
Fortran77 (with some optional Fortran90 constructs, IIRC),
Objective-C, and (now) a few, experimental Chill and Java front ends.
More information on GCC 2.95 is available at 
<URL: http://egcs.cygnus.com>.

It is possible now to compile programs for the i386-mingw32 target, a
native target for Win32 systems.  Such programs use a Microsoft DLL as
its C runtime library (CRTDLL.dll by default, MSVCRT.dll as an
option).  Unlike the i586-cygwin32 target 
<URL: http://sourceware.cygnus.com/cygwin>, the i386-mingw32 target
does not require the program to link with the Cygwin DLL.
Consequently, there are *no* licence restrictions imposed on the
resulting program (not by the compiler at any rate; linking against
third-party code might restrict use).  Information on the Win32 port
of GCC, and the port itself, are at 
<URL: http://www.xraylith.wisc.edu/~khan/software/gnu-win32/gcc.html>.

Paul Sokolovsky originally patched the Python headers to allow the
then-EGCS to compile Python extension modules for the i386-mingw32
target.  I now maintain a web page containing instructions on setting
up the compiler, headers, and the other related paraphenalia required.

My page is 
<URL: http://starship.python.net/crew/kernr/mingw32/Notes.html>.

<P><A
HREF="http://starship.python.net/crew/kernr/mingw32/Notes.html">Compiling
Python Extensions on Win32 with GCC 2.95</A> - Instructions to assist
compiling Python extensions on Win32 OS's with free tools (10-Aug-99)

Robert Kern           |
----------------------|"In the fields of Hell where the grass grows high
This space            | Are the graves of dreams allowed to die."
intentionally         |           - Richard Harter
left blank.           |




More information about the Python-list mailing list