所以,我想使用mingw编译py2exe &我得到了一个错误。有谁知道怎么解决这个问题吗?
D:\devel\py2exe-0.6.9>python setup.py build -cmingw32
running build
running build_py
creating build
creating build\lib.win32-2.7
copying zipextimporter.py -> build\lib.win32-2.7
creating build\lib.win32-2.7\py2exe
copying py2exe\boot_common.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_com_servers.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_ctypes_com_server.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_service.py -> build\lib.win32-2.7\py2exe
copying py2exe\build_exe.py -> build\lib.win32-2.7\py2exe
copying py2exe\mf.py -> build\lib.win32-2.7\py2exe
copying py2exe\__init__.py -> build\lib.win32-2.7\py2exe
creating build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\StringTables.py -> build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\VersionInfo.py -> build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\__init__.py -> build\lib.win32-2.7\py2exe\resources
running build_ext
building '_memimporter' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\source
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DPYTHONDLL=\"PYTHON27.DLL\" -DPYTHONCOM=\"pythoncom27.dll\" -IC:\Python27\include -IC:\Python27\PC -c source/MemoryModule.c -o build\temp.win32-2.7\Release\source\memorymodule.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1如何从构建选项中删除-mno-cygwin?
发布于 2011-11-17 19:44:38
这是一个已知的问题,是由于Python开发人员跟踪MinGW GCC的开发而导致的:
http://bugs.python.org/issue12641
自2010年以来,由于混淆了使用开关的人,GCC删除了这一选项。bug报告包含对Python的distutils配置文件之一的修复,您可以在不重新构建Python或任何其他内容的情况下应用该文件。
更新:错误很明显,您正在编译的代码正在重新定义Python头文件中定义的类型:
source/Python-version.h:13:18: error: redefinition of typedef 'Py_ssize_t'
C:\Python27\include/pyport.h:172:25: note: previous declaration of 'Py_ssize_t'在您的代码中删除Py_ssize_t的类型定义。可能有一些配置库出现问题。在修复-mno-cygwin问题后,请确保执行干净的重建。
https://stackoverflow.com/questions/8165119
复制相似问题