PythonXY:在Windows上编译C扩展时出错:`.data';collect2.exe:错误:ld返回了1个退出状态

PythonXY:在Windows上编译C扩展时出错:`.data';collect2.exe:错误:ld返回了1个退出状态,python,gcc,windows-7-x64,mingw32,pythonxy,Python,Gcc,Windows 7 X64,Mingw32,Pythonxy,在Windows7机器(64位)上使用最新版本的PythonXY和mingw32编译pyxrr()时,我遇到了一个问题。 在过去,在类似的机器上编译是没有问题的 给出了以下错误输出: run setup.py build -c mingw32 running build running build_py running build_ext building 'pyxrr.xrr' extension C:\MinGW32-xy\bin\gcc.exe -mdll -O -Wall -IC:\Py

在Windows7机器(64位)上使用最新版本的PythonXY和mingw32编译pyxrr()时,我遇到了一个问题。 在过去,在类似的机器上编译是没有问题的

给出了以下错误输出:

run setup.py build -c mingw32
running build
running build_py
running build_ext
building 'pyxrr.xrr' extension
C:\MinGW32-xy\bin\gcc.exe -mdll -O -Wall -IC:\Python27\lib\site-packages\numpy\c
ore\include -IC:\Python27\include -IC:\Python27\PC -c pyxrr/xrr.c -o build\temp.
win32-2.7\Release\pyxrr\xrr.o -fopenmp
In file included from C:\Python27\lib\site-packages\numpy\core\include/numpy/nda
rraytypes.h:1761:0,
                 from C:\Python27\lib\site-packages\numpy\core\include/numpy/nda
rrayobject.h:17,
                 from C:\Python27\lib\site-packages\numpy\core\include/numpy/arr
ayobject.h:4,
                 from pyxrr/xrr.c:26:
C:\Python27\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:
12:9: note: #pragma message: C:\Python27\lib\site-packages\numpy\core\include/nu
mpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disa
ble it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it by " \
         ^
writing build\temp.win32-2.7\Release\pyxrr\xrr.def
C:\MinGW32-xy\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\pyxrr\xrr.o bu
ild\temp.win32-2.7\Release\pyxrr\xrr.def -LC:\Python27\libs -LC:\Python27\PCbuil
d -lpython27 -lmsvcr90 -o build\lib.win32-2.7\pyxrr\xrr.pyd -fopenmp
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0x188): undefined referenc
e to `cexp'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0x32c): undefined referenc
e to `cexp'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0x42c): undefined referenc
e to `cexp'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0xb4a): undefined referenc
e to `cexp'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0xccf): undefined referenc
e to `cexp'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0xda5): more undefined ref
erences to `cexp' follow
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0x100e): undefined referen
ce to `csqrt'
build\temp.win32-2.7\Release\pyxrr\xrr.o:xrr.c:(.text+0x1898): undefined referen
ce to `csqrt'
c:/mingw32-xy/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build
\temp.win32-2.7\Release\pyxrr\xrr.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
An exception has occurred, use %tb to see the full traceback.

SystemExit: error: command 'gcc' failed with exit status 1
如果不使用多处理选项和库(-single core标志),则会发生相同的错误。我在网上搜索,并尝试了不同的编译器选项,如-lm、-DKM_WIN32等,但没有效果。但是python和mingw都是32位版本

显然,他没有发现复杂的.h库函数实际上是标准的。 我在两台不同的Win7机器上试过这个。此外,使用Anaconda编译也适用于单线程版本

因为我不太明白问题所在,我希望有人能告诉我问题所在

任何暗示都很感激,
谢谢大家!

顺便说一句,它可以在较早的PythonXY版本和Linux上正常工作。嘿,你能解决这个问题吗?我在Windows7 64位上的另一个库中遇到了类似的错误。目前,我使用的是编译它的pythonXY的旧版本。当然这不是很令人满意