qt - C++ Qt - 如何将 "-std=c++11"添加到 qmake 生成的 makefile 中?

标签 qt c++11 makefile qmake

我正在用 Qt 开发一个程序。它的 makefile 是从 .pro 文件自动生成的。我需要使用一些需要为 g++ 设置 -std=c++11 标志的代码。我应该在 .pro 中的哪个位置添加此标志? (仅更改 Makefile 是行不通的,因为每次构建项目时它都会被新生成的文件覆盖)。

最佳答案

您可以将以下内容添加到 C++11 的 Qt .pro 中:-

CONFIG += c++11

从 Qt 5.4 开始,可以通过以下方式启用 C++14

CONFIG += c++14

关于qt - C++ Qt - 如何将 "-std=c++11"添加到 qmake 生成的 makefile 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19398438/

相关文章:

qt - 是否有用于验证 QT 端口的测试套件?

c++ - 编译Qt项目,出现错误QQmlEngine : No such file or directory compilation terminated

QtLinguist : Define a single context

c++ - Qt 程序的速度性能 : Windows vs Linux

C++11 is_pod 与 GCC 4.6

Python Audio Tools 安装问题

makefile - Makefile 应该在 'make clean' 上删除自己吗?

c++ - C++11 中的高效 Argmin

c++ - MinGW 4.6.2 std::原子指针

c++ - 体系结构 x86_64 的 undefined symbol ,链接器命令失败