相关疑难解决方法(0)

使用cython和mingw进行编译会产生gcc:错误:无法识别的命令行选项'-mno-cygwin'

我正在尝试使用mingw(64位)在win 7 64位中使用cython编译python扩展.
我正在使用Python 2.6(Active Python 2.6.6)和足够的distutils.cfg文件(将mingw设置为编译器)

执行时

> C:\Python26\programas\Cython>python setup.py build_ext --inplace
Run Code Online (Sandbox Code Playgroud)

我得到一个错误,说gcc没有-mno-cygwin选项:

> C:\Python26\programas\Cython>python setup.py build_ext --inplace
running build_ext
skipping 'hello2.c' Cython extension (up-to-date)
building 'hello2' extension
C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c hello2.c -o build\temp.win-amd64-2.6\Release\hello2.o
gcc: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

gcc是:

C:\>gcc --version
gcc (GCC) 4.7.0 20110430 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.
Run Code Online (Sandbox Code Playgroud)

我该怎么办呢?

python distutils mingw cython

114
推荐指数
3
解决办法
6万
查看次数

标签 统计

cython ×1

distutils ×1

mingw ×1

python ×1