首页 > 解决方案 > How to fix error: Cygwin gcc cannot be used with --compiler=mingw32

问题描述

I'm trying to install this project: https://github.com/drufat/triangle. Unfortunatly, I get the following error:

error: Cygwin gcc cannot be used with --compiler=mingw32

I'm using the lastest version of gcc for Cygwin on Windows 7 64 bit and I'm trying to install that project for python 3.7.1. It's seems to come from my distutil configuration. My distutils.cfg file contains:

[build]
compiler=mingw32

I tried that solution but it doens't helped: https://stackoverflow.com/a/16740123/5075502

标签: python-3.xwindowscygwinsetuptools

解决方案


The gcc options to build for MinGW64 is no longer supported by the regular cygqin compiler gcc, aka x86_64-pc-cygwin-gcc. Instead, you should also install the mingw64-x86_64-gcc-core package which provides the GCC for Win64 toolchain (C, OpenMP). This will also install other packages (through dependencies) which provide compatible binutils, headers, libraries, and runtime.

In your Makefile or compiler command line, replace gcc with x86_64-w64-mingw32-gcc. This will allow you to compile and link executables which do not depend on the cygwin1.dll.


推荐阅读