Python.h在Windows中存在时未找到

Python.h not found when it exists Windows

本文关键字:存在 Windows Python      更新时间:2023-10-16

我只是想让它编译,然后继续执行实际的代码,但每当我试图编译它时,它都会说fatal error: Python.h: No such file or directory我已经尝试了一切,但仍然如此。我正在使用NetBeans,在"附加库目录"中我放入C:/Python27/libs,在"包含目录"中放入C:/Python27/include

#include <iostream>
#include <Python.h>
using namespace std;
int main(int argc, char** argv) {
    cout << "Hello World!";
    return 0;
}

Python.h本身需要在include路径中,库也需要在库路径中。