0
我尝试cythonize
下面的代码:我不能编译C++代码用Cython
from libcpp.vector import vector
from libcpp cimport bool
def test():
cdef vector[bool] = pos(top, 0)
return 1
有:
cython test.pyx --cplus -o test.cpp
然而其结果是:
Error compiling Cython file:
------------------------------------------------------------
...
from libcpp.vector import vector
from libcpp cimport bool
def test():
cdef vector[bool] = pos(top, 0)
^
------------------------------------------------------------
test.pyx:5:19: Empty declarator
Error compiling Cython file:
------------------------------------------------------------
...
from libcpp.vector import vector
from libcpp cimport bool
def test():
cdef vector[bool] = pos(top, 0)
^
------------------------------------------------------------
我承担我错过了一些简单的使用c++
,但我无法弄清楚究竟是什么。任何帮助都将被极大地占用。
我什么都不知道用Cython,但不是你缺少你定义的东西的名称? – Mat 2015-02-09 09:53:10
这是什么'cdef'应该说。对我来说,Python或C/C++都没有意义。 – 2015-02-09 09:55:26
@StephenC'cdef'应该引入c/C++数据类型。 – 2015-02-09 10:19:27