|
Cython生成c文件,然后c++调用问题.
本人使用py生成test文件代码如下:
# cython: language_level=3, boundscheck=False
cdef public ml_lith():
print("hello world")
使用cython test.pyx命令生成了test.h test.c两个文件
导入工程中.main.cpp如下
#include <stdio.h>
#include <python.h>
#include "test.h"
int main(int argc, char *argv[])
{
Py_Initialize();
if (!Py_IsInitialized()) {
return 1;
}
PyInit_test();
testcy( );
Py_Finalize();
return 1;
}
当运行到testcy( );就报错.
运行环境为python3.72.我重新测试了python3.5.也是如此
请教一下是哪里出问题了呢?谢谢大家!
|
|