#define QT_DO_PRAGMA(text) _Pragma(#text)

cpp 复制代码
/opt/Qt-5.15.2/include/QtCore/qcompilerdetection.h:1253:49: 错误:expected declaration before end of line
 #define QT_DO_PRAGMA(text)                      _Pragma(#text)

编译报错的原因是:有两个.h文件#define了相同的起始宏。