extending python with a C-written dll

Scott David Daniels Scott.Daniels at Acm.Org
Tue Dec 21 15:03:45 EST 2004


Jean-Baptiste PERIN wrote:
> I can already conclude that either I don't know how to use lcc
> or it doesn't suit my needs ..
> I plan to first test the cygwin's gcc compiler before goign to MinGW32

MinGW32 is "Minimalist Gnu for Windows -- 32-bit," and _works_ at
being ABI compatible with Microsoft's ABI and its C runtime.  Cygwin
is a way of building a *nix-compatible toolset _on_ Windows, not _in_
windows.  What that means (as far as I understand the issues) is that
you'll need to build a Cygwin python in order to use Cygwin modules.
I put in a bit of effort to make sure Python could build for that
compiler (not by MinGW-specific code, but by cleaning up an issue in
the CPython header file for non-MS compilers).  There are toolchain
issues to consider (not just the compiler itself, , but function call
conventions, global access, linker/loader, and debugger symbols and
access are involved).

Python 2.4's jump to a new C compiler on windows is a well-justified
decision (Windows C/C++ 6.0's stuff is getting long in the tooth), but
short-term disruptive to small-time Python C module development.  The
change does not portend a continuous series of compiler-jumps, but
rather a hope to not become hopelessly mired in ancient history.  It
is getting hard (or is impossible, I don't know which) to purchase
Windows C/C++ 6.0 for money these days, and this will only get harder.

In short, I urge you to go with MinGW if you are hoping to write for
windows with a GNU compiler; you'll be swimming upstream a bit less.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list