在Qtcreator中编译C ++ 14 [英] Compilation of C++14 in qtcreator
问题描述
我有一个qt项目,其中包含 C ++ 14
中的部分。
I have a qt project containing parts in C++14
.
最近,我更改了Ubuntu发行版。现在我有16.04 LTS,并安装了Qt creator 4.02(建于6月13日)。
Recently, I changed my ubuntu distro. Now I have 16.04 LTS and I installed Qt creator 4.02 (built on jun 13).
为了启用 C ++ 14
编译,我将其放在项目文件中:
In order to enable C++14
compilation, I put in the project file:
QMAKE_CXXFLAGS += -std=c++14
但是,在构建项目时,IDE会生成以下命令:
However, when building project, the IDE generates the following command:
g++ -c -pipe -std=c++14 -g -O0 -g -std=gnu++11 -Wall -W -D_REENTRANT ...
如图所示,生成的 makefile
将标志 -std = gnu ++ 11
会覆盖 C ++ 14
的标志。这与我以前的发行版(LTS 12.04,相同的qt创建者版本)并没有发生。
As seen, the generated makefile
puts the flag -std=gnu++11
which overrides the flag for C++14
. This did not happen with my previous distro (LTS 12.04, same qt creator version).
我尝试过
CONFIG += -std=c++14
但是
有人可以提供任何线索吗?
Could someone give any clue?
推荐答案
而不是:
CONFIG += -std=c++14
使用:
CONFIG += c++14
这篇关于在Qtcreator中编译C ++ 14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!