简体   繁体   English

使用Cython生成C代码时出现“未知类型名称”错误

[英]'unknown type name' error while using Cython to generate C code

I have successfully generated .c file using Cython, but when i try to compile it using gcc, i get these errors... This is just the first line of the error... There are 3 pages of errors similar to this... My .py code is a simple: 我已经使用Cython成功生成了.c文件,但是当我尝试使用gcc进行编译时,出现了这些错误...这只是错误的第一行...共有3页类似的错误。我的.py代码很简单:

print "test"

error: 错误:

unknown type name ‘Py_UNICODE’
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)

See this mailing list post . 请参阅此邮件列表帖子

Citing it: 引用:

Cython is not a Python to C compiler in the sense that it does away
with the Python interpreter/runtime, rather it creates .c files that
are compiled against the Python/C API and can be loaded into a running
session. 

See this list of interpreters which lists some compilers that might be useful to you! 请参阅此解释列表,其中列出了一些可能对您有用的编译器!

For a guide to compilation, also have a look at the compilation page of the Cython wiki 有关编译的指南,还请查看Cython Wiki的编译页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM