Compiling python extensions on Windows

Mark Hadfield m.hadfield at niwa.cri.nz
Mon May 28 00:16:27 CEST 2001


From: "Tim Peters" <tim.one at home.com>
> I suspect your problems are due to mixing builds.  If you're going to do
> Windows work under Cygwin, stick with the Cygwin stuff.  If you're
> going to do Windows work under Windows, avoid the Cygwin stuff.

Yes, but you can, if you wish, build extensions for Windows-native Python
using Cygwin's gcc compiler in "Mingw" mode. This is easily done by writing
a setup.py script for the extension (see Alex Martelli's message in this
thread) then building it with

    python setup.py build --compiler=mingw32

It causes Cygwin's gcc to be called with the "-mno-cygwin" switch so that
the binaries do not link to Cygwin's Unix-emulation DLL.

---
Mark Hadfield
m.hadfield at niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




-- 
Posted from clam.niwa.cri.nz [202.36.29.1] 
via Mailgate.ORG Server - http://www.Mailgate.ORG



More information about the Python-list mailing list