首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >py2exe明码编译

py2exe明码编译
EN

Stack Overflow用户
提问于 2011-11-17 17:52:03
回答 1查看 2.7K关注 0票数 2

所以,我想使用mingw编译py2exe &我得到了一个错误。有谁知道怎么解决这个问题吗?

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-17 19:44:38

这是一个已知的问题,是由于Python开发人员跟踪MinGW GCC的开发而导致的:

http://bugs.python.org/issue12641

自2010年以来,由于混淆了使用开关的人,GCC删除了这一选项。bug报告包含对Python的distutils配置文件之一的修复,您可以在不重新构建Python或任何其他内容的情况下应用该文件。

更新:错误很明显,您正在编译的代码正在重新定义Python头文件中定义的类型:

代码语言:javascript
复制
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问题后,请确保执行干净的重建。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8165119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档