擅长:python、mysql、java
<p>也许这不是你想要的,但我是通过以下改变来实现的:</p>
<p>在quacker.pyx中我添加了</p>
<pre><code>cdef public int i
</code></pre>
<p>强制Cython生成<code>.h</code>文件。</p>
<p>总的来说:</p>
<pre><code>#include <Python.h>
#include "caller.h"
#include "quacker.h"
int main() {
Py_Initialize();
initquacker();
initcaller();
call_quack();
Py_Finalize();
return 0;
}
</code></pre>