Infallible Logic

18Feb/120

cc1.exe: error: unrecognized command line option ‘-mno-cygwin’

All I was really trying to do was install the hg-git extension, but somehow this led me to have to install:

  1. Python
  2. Cygwin
  3. MinGW

I really hate doing development on Windows, which is why I usually avoid this crap, but I wanted to upload one of my projects to Github without having to remember how on Earth to install Git on Windows properly again. Maybe it would've been easier than this, but I digress.

The -mno-cygwin option doesn't actually exist anymore in the newer versions of gcc. But Windows Python 2.7's (I didn't try the others) distutils still tries to call it anyway if you actually need something compiled. After actually way more Googling than I probably should have needed, I finally stumbled upon this Stack Overflow answer.

Basically, you just need to edit [YourPythonInstallPath]\Lib\distutils\cygwinccompiler.py and remove all traces of -mno-cygwin, and try again and it'll probably work fine. Assuming you don't run into other errors (like say, actually trying to use 64-bit Python...).