小编Pet*_*nen的帖子

Cython hello world示例不能正常工作

大家好,谢谢你们.

我正在测试Cython并且我已经开始了最简单的情况,但是在编译时遇到了错误.使用:Python 2.7,最新的cython和minGW.我编辑了cygwinccompiler.py并删除了-mno-cygwin行.

C:\Playground\demo_heeds\cython_test>python setup.py build_ext --inplace
running build_ext
skipping 'hello.c' Cython extension (up-to-date)
building 'hello' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c he
llo.c -o build\temp.win-amd64-2.7\Release\hello.o
writing build\temp.win-amd64-2.7\Release\hello.def
C:\MinGW\bin\gcc.exe -shared -s build\temp.win-amd64-2.7\Release\hello.o build\t
emp.win-amd64-2.7\Release\hello.def -LC:\Python27\libs -LC:\Python27\PCbuild\amd
64 -lpython27 -lmsvcr90 -o C:\Playground\demo_heeds\cython_test\hello.pyd
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x8b): undefined referen
ce to `_imp__PyOS_snprintf'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x93): undefined referen
ce to `_imp__Py_GetVersion'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0xfb): undefined referen
ce to `_imp__PyOS_snprintf'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x114): undefined refere
nce to `_imp__PyErr_WarnEx'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x12e): undefined refere
nce to `_imp__PyTuple_New'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x150): undefined refere
nce to `_imp__PyString_FromStringAndSize'
build\temp.win-amd64-2.7\Release\hello.o:hello.c:(.text+0x18a): …
Run Code Online (Sandbox Code Playgroud)

python windows mingw cython

2
推荐指数
1
解决办法
1747
查看次数

标签 统计

cython ×1

mingw ×1

python ×1

windows ×1