pythoncwindowsmingw

Using MinGW C compiler instead of Microsoft Visual Studio Express for Python


I am trying to install the python Package pyOpt and have difficulties using Microsoft Visual Studio Express because I am running a 64 bit install of Python.

The pyOpt developers recommend using MinGW-W64 if the system doesn't have access to other c/Fortran compilers.

I have now installed MinGW-W64 but it seems like the standard python setup.py install seems to still want to use VS.

How do I tell the installer to rather use MinGW's compiler instead? Should MinGW come with the necessary c compiler out of the box or must I first install one in MinGW?


Solution

    1. Just start %APPDATA%\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat amd64 and you will get environment for 64-bit Python

    2. MinGW compiler needs lot of tweaking in order to link with correct msvcr90.dll library but compiling with MinGW is possible too - https://web.archive.org/web/20190327125849/http://www.mingw.org/wiki/HOWTO_Use_the_GCC_specs_file