QT C++调用python之错误:XXX\python\include\object.h:227: error: C2059: 语法错误:“;”

问题:

 

解决:

1、重命名C++中的slots

class MyClass {
public:
    PyType_Slot *slotTable;
};

 

2、在includ <Python.h>前使用#undef取消定义

#ifdef slots
#undef slots
#endif
#include <Python.h>

 

posted @ 2024-09-24 15:49  hxqmw  阅读(236)  评论(0)    收藏  举报