Qt 6.2 报错“Qt requires a C++17 compiler...”的解决方法

Qt 6.2 报错“Qt requires a C++17 compiler...”的解决方法,第1张

问题

Qt 6.2 + VS2019 环境编译,报错

"Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
解决

在工程 pro 文件中添加一下代码:

CONFIG += c++17
QMAKE_CXXFLAGS += -std:c++17 -Zc:__cplusplus

再次编译,问题解决。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1498752.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-25
下一篇 2022-06-25

发表评论

登录后才能评论

评论列表(0条)

保存