如何更正未知类型名称';PyTypeObject';使用Python.h时出错?
我使用Python.h编写了以下程序如何更正未知类型名称';PyTypeObject';使用Python.h时出错?,python,c++,c,python-3.x,embedding,Python,C++,C,Python 3.x,Embedding,我使用Python.h编写了以下程序 #include <stdio.h> #include <Python.h> int main() { return 0; } 多次 及 一次 还有这些 254 35 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\cpython\abstract.h [Error] unknown type name '
#include <stdio.h>
#include <Python.h>
int main()
{
return 0;
}
多次
及
一次
还有这些
254 35 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\cpython\abstract.h [Error] unknown type name 'Py_buffer'
175 53 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\cpython\abstract.h [Error] unknown type name '_Py_Identifier'
编译时,它还会打开objimpl.h,其中提到一行,其中有“PyTypeObject”一词
我使用DevCpp-gcc-4.9.2你读过吗?我不知道这是否有帮助,但请注意,由于Python可能会定义一些影响某些系统上标准头的预处理器定义,因此必须在包含任何标准头之前包含Python.h。我尝试先包含Python.h,但仍然出现相同的错误。
35 5 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\funcobject.h [Error] unknown type name 'vectorcallfunc'
254 35 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\cpython\abstract.h [Error] unknown type name 'Py_buffer'
175 53 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\cpython\abstract.h [Error] unknown type name '_Py_Identifier'