我尝试在 http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html上运行 cython 示例 我基本上只是复制了 Rectangle.h、Rectangle.cpp、setup.py 和 rect.pyx 中的代码但是,当我运行 python setup.py build_ext --inplace 我得到了错误
running build_ext
building 'rect' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c rect.c -o build/temp.linux-x86_64-2.7/rect.o
In file included from rect.c:235:0:
Rectangle.h:1:1: error: unknown type name ‘namespace’
Rectangle.h:1:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
rect.c:236:15: fatal error: ios: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
我究竟做错了什么???