1

我正在尝试从此处http://blog.perrygeo.net/2008/04/19/a-quick-cython-introduction/遵循 Cython 构建的示例,但我的 c1.pyx 只是带有“打印”的 helloworld.pyx “你好世界””:

# this will create a c1.c file - the C source code to build a python extension
cython c1.pyx

# Compile the object file   
gcc -c -fPIC -I/usr/include/python2.5/ c1.c

# Link it into a shared library
gcc -shared c1.o -o c1.so

我在命令行中执行此操作的原因是因为我的 setup.py 给了我一个错误,所以我手动执行此操作以查看问题所在。

最后一步(gcc -shared c1.o -o c1.so)是我遇到以下错误的地方:

c:/users/MyName/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../..
/x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc
c:/users/MyName/anaconda/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../..
/x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\Users\\MyName\\Anaconda\\Scripts\\gcc.bat' failed with exit st
atus 1

有什么建议么?

EDIT1:感谢@mat 的编辑。另外,我注意到我的计算机上没有安装 Visual C++ 2008。不确定 Anaconda 是否需要 GCC 以及这是否是解决方案。

4

0 回答 0