Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更正未知类型名称';PyTypeObject';使用Python.h时出错?_Python_C++_C_Python 3.x_Embedding - Fatal编程技术网

如何更正未知类型名称';PyTypeObject';使用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 '

我使用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 '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'