首先给问题截个图:
第一个:
D:\Qt\Qt5.12.2\Tools\mingw730_64\lib\gcc\x86_64-w64-mingw32\7.3.0\include\c++\bits\streambuf_iterator.h:155: error: there are no arguments to '_M_message' that depend on a template parameter, so a declaration of '_M_message' must be available [-fpermissive] _M_message(__gnu_debug::__msg_inc_istreambuf) ^~~~~~~~~~
第二个:
D:\Qt\Qt5.12.2\Tools\mingw730_64\lib\gcc\x86_64-w64-mingw32\7.3.0\include\c++\bits\streambuf_iterator.h:140: error: '__gnu_debug' has not been declared
_M_message(__gnu_debug::__msg_inc_istreambuf)
^~~~~~~~~~~
第三个:
D:\Qt\Qt5.12.2\Tools\mingw730_64\lib\gcc\x86_64-w64-mingw32\7.3.0\include\c++\bits\basic_string.h:1246: error: '__glibcxx_requires_string' was not declared in this scope
__glibcxx_requires_string(__s);
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
笔者亲身经历了这些荒诞的问题,并且解决的过程非常痛苦。下面说下我的解决办法:
下面是我的代码根目录,红色方框中的目录(也包含目录中的文件)在工程中没有被引用,也没有加入到pro文件中,我把代码根目录下无关的目录和文件删除后,重新编译就成功了。
最后吐槽下,Qt 5.12.2编辑功能太垃圾,类成员输入提示功能经常失效。