How to set C++ standard in QtCreator with ClangCodeModel plugin?

左心房为你撑大大i 提交于 2020-04-14 07:00:32

问题


Sorry if this is a dumb question, but I have already tried almost everything and am banging my head against a wall right now..

The problem is, QtCreator 4.8.0-beta for Windows with Clang Code Model plugin parses my project as C++98 whereas in fact it is C++17. However specifying the standard version explicitly in the settings dialog is not allowed ("Option "-std=c++17" is invalid").

So, how do I tell ClangCodeModel that it should parse code as C++17? I use CMake for building the project and have set (CMAKE_CXX_STANDARD 17) in the top-level CMakeLists.txt file.

Thanks!


回答1:


I think your question is similar to This one, According to the link, dated October 2018, it is an issue of QtCreator and does not seem to have been solved. However I would suggest you to test yourself the solution proposed in the link, infact it may work on your pc. If you are still stuck into this problem, try to install the latest version of Qt 5



来源:https://stackoverflow.com/questions/53481748/how-to-set-c-standard-in-qtcreator-with-clangcodemodel-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!