Simon 's Blog
» 做笔记做笔记
Toggle navigation
Simon 's Blog
HOME
总裁介绍
coper
zongcai
what
ARCH
TAGS
navigation
!!! qt5.14+ moc bug(handle include directives in enums)
无
2020-06-19 17:07:01
650
0
0
simon88
[TOC] # 问题1 ```Shell The moc process failed to compile "SRC:/..............." into "Src:/................................." command -------- path/to/path ``` # 问题2 ```Shell 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`,然后重新编译即可。加入代码如下:  也可以复制一下代码: ```C++ 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)); ``` 从以下下载程序,替换原来的moc.exe程序即可。 - 下载地址1:[moc.exe](https://leanote.com/api/file/getAttach?fileId=5eec7c64ab644170190007fd) - 下载地址2:[moc.exe](https://download.csdn.net/download/u014751788/12535935)(推荐) 原博文:[qt5.14+ moc bug(handle include directives in enums)](https://blog.csdn.net/u014751788/article/details/106859910)
上一篇:
半边数据结构
下一篇:
IDEA RUST插件
0
赞
650 人读过
新浪微博
微信
腾讯微博
QQ空间
人人网
提交评论
0
条评论
More...
<>