编译cython模块工作在32位但不是64位[Windows]

时间:2015-06-04 15:33:00

标签: python windows numpy 64-bit cython

我有一个cython模块(使用numpy)编译并以32位工作,执行以下操作:

C:\Python27_x86\Scripts\cython.exe OrderC.pyx
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27_x86\lib\site-packages\numpy\core\include -IC:\Python27_x86\include -IC:\Python27_x86\PC -c OrderC.c -o OrderC.o
C:\MinGW\bin\gcc.exe -shared -s OrderC.o -LC:\Python27_x86\libs -LC:\Python27_x86\PCbuild -lpython27 -lmsvcr90 -o OrderC.pyd

但是当我尝试使用64位的等效编译时,它无法正常工作:

C:\Python27\Scripts\cython.exe OrderC.pyx
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c OrderC.c -o OrderC.o
C:\MinGW\bin\gcc.exe -shared -s OrderC.o -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o OrderC.pyd

实际上,它是第三行失败并且给出了一些错误:

OrderC.o:OrderC.c:(.text+0x43f2c): undefined reference to `_imp__PyExc_TypeError'
...
OrderC.o:OrderC.c:(.text+0x603a9): undefined reference to `_imp__PyType_Ready'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: OrderC.o: bad reloc address 0x0 in section `.data'

collect2.exe:错误:ld返回1退出状态

是因为mingw只编译32位吗?你能帮我一下吗?

由于

0 个答案:

没有答案