I recently tried to make use of the PyOPL library, which makes use of C++ extensions for Python. Getting the code compiling in Windows using MinGW was a bit of a chore, as it's expecting to use Microsoft Visual Studio's C++ compiler. Getting MinGW working required a few extra steps.
- Download and install MinGW (including both the C and C++ GNU compilers)
- Add mingw32's "bin" directory to your PATH environment variable; e.g. append PATH with "c:\MinGW\bin;"
- Create (or edit) a "distutils.cfg" file in "C:\Python27\Lib\distutils\distutils.cfg" (alter the path to match your Python installation)
- In "distutils.cfg", add this text:
[build] compiler=mingw32
- Edit "C:\Python27\Lib\distutils\cygwinccompiler.py", do a find & replace to remove all references to " -mno-cygwin" (this option was removed from GCC)