How To Compile Python Extensions On Windows/Cygwin
There are a lot of descriptions out there of how to do this, and most of them are outdated or just plain wrong. Here's what worked for me, yesterday. It assumes you've got Cygwin + gcc and the windows version of python 2.4, all installed into the default locations:
- Get pexport and extract it into a directory
- copy c:/Winnt/system32/python24.dll to the pexport directory
- run pexports python24.dll > python24.def
- run dlltool --dllname python24.dll --def python24.def --output-lib libpython24.a
- copy libpython24.a to c:\python24\libs\
- run c:\python24\python.exe setup.py build --compiler=mingw32
UPDATE: To compile python extensions with python 2.5, check out this link.