linux下C调用python 编译出错
#include "/usr/local/include/python3.6m/Python.h"
int main(int argc, char** argv){
Py_Initialize();
PyRun_SimpleString("print 'hello python'");
Py_Finalize();
exit(0);
}
编译指令 gcc -I/usr/include -L/usr/local/lib -lpython3.6m python.c
提示:/tmp/ccYoHGsy.o: In function `main':
python.c:(.text+0xa): undefined reference to `Py_Initialize'
python.c:(.text+0x1e): undefined reference to `PyRun_SimpleStringFlags'
python.c:(.text+0x23): undefined reference to `Py_Finalize'
collect2: ld 返回 1
在usr/local/lib 中有libpython3.6m.a 文件 求问如何解决!