小编use*_*777的帖子

由 locate 找到但不是由 GCC 找到的 Python.h

我只是写了一个简单的 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-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我的系统上有头文件。如何让我的可执行文件正常工作?

python c

13
推荐指数
2
解决办法
3万
查看次数

标签 统计

c ×1

python ×1