2014-01-27 46 views
1

我已經使用Cython成功生成了.c文件,但是當我嘗試使用gcc編譯它時,我得到了這些錯誤...這只是第一行錯誤......有3頁類似的錯誤的...我的.py代碼是一個簡單:使用Cython生成C代碼時'unknown type name'錯誤

print "test" 

錯誤:

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

PyPy是JIT。它不生成C代碼。是什麼讓你認爲PyPy可以爲你做到這一點? –

+0

我一直在嘗試使用cython和pypy,並且似乎我已經誤解了cypy的pypy ... – user1176999

+0

好的,相應地編輯了您的問題! –

回答

0

this mailing list post

引用它:

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. 

this list of interpreters列出一些編譯器可能對你有用!

的指南,彙編,也看看the compilation page of the Cython wiki

+0

當然,但爲什麼不能離開中間的.c文件? –

+0

@ IgnacioVazquez-Abrams一旦獲得'.pyx'文件,確實可以編譯爲C,參見http://docs.cython.org/src/reference/language_basics.html –