我花了很多时间尝试构建PyCPUID
我在使用 Python 2.7 64 位的 Windows 7 64 位上。我已经安装了 cygwin,所以我可以尝试使用这个命令进行构建
python setup.py build -c mingw32
这导致
error: command 'gcc' failed: Permission denied
是的,我正在使用管理员权限运行。(mingw32 也是 32 位编译器吗?)我也尝试从 cygwin 终端运行它。
我知道 c:\cygwin\bin\gcc.exe 是符号链接或其他东西在 Windows 上的一些问题,所以我将 gcc-3.exe 重命名为 gcc,这让我更进一步,但那失败了
$ python setup.py build -c mingw32
running build
running build_py
running egg_info
writing requirements to PyCPUID.egg-info\requires.txt
writing PyCPUID.egg-info\PKG-INFO
writing top-level names to PyCPUID.egg-info\top_level.txt
writing dependency_links to PyCPUID.egg-info\dependency_links.txt
reading manifest file 'PyCPUID.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'requirements-jenkins.txt'
no previously-included directories found matching 'doc\build'
warning: no previously-included files found matching '.bzr'
warning: no previously-included files found matching 'build'
warning: no previously-included files found matching 'dist'
warning: no previously-included files found matching 'jenkins'
warning: no previously-included files found matching '.coverage'
warning: no previously-included files found matching 'coverage.xml'
warning: no previously-included files found matching 'nosetests.xml'
writing manifest file 'PyCPUID.egg-info\SOURCES.txt'
running build_ext
building 'pycpuid._pycpuid' extension
C:\cygwin\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c pycpuid/_pycpuid.c -o build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o
writing build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.def
C:\cygwin\bin\gcc.exe -mno-cygwin -shared -s build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.def -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\pycpuid\_pycpuid.pyd
build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o:_pycpuid.c:(.text+0x2e): undefined reference to `__imp__PyArg_ParseTuple'
build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o:_pycpuid.c:(.text+0x6a): undefined reference to `__imp__Py_BuildValue'
build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o:_pycpuid.c:(.text+0xa7): undefined reference to `__imp__Py_InitModule4'
/usr/bin/ld: build\temp.win-amd64-2.7\Release\pycpuid\_pycpuid.o: bad reloc address 0x0 in section `.data'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
而我现在完全不知所措。有任何想法吗?