問題1
The moc process failed to compile
"SRC:/..............."
into
"Src:/................................."
command
--------
path/to/path
問題2
tbb/tbb_profiling.:28: Parse error at "{"
問題分析
該bug在5.14已經出現過,5.15仍然未能解決,問題的原因在於moc過程中
不支持處理enum
包含#include
頭文件的語法。
解決方案1
- 下載
qt-everywhere-src-5.15.0
源代碼。 - 進入
qt-everywhere-src-5.15.0\qtbase\src\tools\moc
。 - 用
qtcreator
雙擊打開moc.pro
。 - 修改文件
moc.cpp
,然後重新編譯即可。加入代碼如下圖:
也可以複製一下代碼:
if (!test(LBRACE))
return false;
auto handleInclude = [this]() {
if (test(MOC_INCLUDE_BEGIN))
currentFilenames.push(symbol().unquotedLexem());
if (test(NOTOKEN)) {
next(MOC_INCLUDE_END);
currentFilenames.pop();
}
};
do {
if (lookup() == RBRACE) // accept trailing comma
break;
handleInclude();
next(IDENTIFIER);
def->values += lexem();
handleInclude();
skipCxxAttributes();
} while (test(EQ) ? until(COMMA) : test(COMMA));
解決方案2
從以下下載程序,替換原來的moc.exe程序即可。