我只是写了一个简单的 C 可执行文件来检查是否Python.h正常工作
#include<Python.h>
#include<stdio.h>
int main()
{
printf("this is a python header file included programm\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
显然,它没有多大作用。但是,当我尝试使用gcc它进行编译时,出现错误:
#include<Python.h>
#include<stdio.h>
int main()
{
printf("this is a python header file included programm\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
然后我检查了python-dev包已
Python.h安装或未使用locate.
foo.c:1:19: fatal error: Python.h: No such file or directory.
Run Code Online (Sandbox Code Playgroud)
我很清楚Python.h我的系统上有头文件。如何让我的可执行文件正常工作?