一. 导入头文件报错
In included file: expected member name or ‘;’ after declaration specifiers object.h:227:23: error occurred here
原因:
This happens because including Python.h first indirectly includes termios.h, which defines B0 to be 0, which in turn qpagedpaintdevice.h want’s to use as a variable name. Including Python.h after the Qt includes does pretty much the same thing the other way around with the string ‘slots’.
解决
-
双击错误打开文件 object.h 文件
-
把冲突的slots 使用undef 和define
PyType_Slot *slots; /* terminated by slot==0. */
更改为
#undef slots
PyType_Slot *slots; /* terminated by slot&#