I'm using Qt Creator on Ubuntu, and I'd like to use the new C++11 features, however they are not enabled by default.
How can I configure Qt Creator to support the new C++11 features?
Yet, according to this article this version of Qt Creator supports C++11. So how do I enable it? Qt Creator is not a compiler. When you read that "Qt Creator supports C++11" it means that the code-completion engine (Clang in this case) supports C++11 syntax.
In addition, the Qt Creator Bare Metal Device plugin provides support for the following compilers: IAREW is a group of C and C++ bare-metal compilers from the various IAR Embedded Workbench development environments. Note: Currently supported architectures are 8051 , AVR , ARM , STM8 , and MSP430 .
qmake got support for CONFIG += c++14 with Qt 5.4, so you can use that for projects where you are comfortable with requiring at least that version of Qt. Be sure to either use the explicit compiler flags, or use the CONFIG option, but not both at the same time, to avoid conflicting switches.
pro file is to list the source files that are involved in a project. Since qmake is used for building Qt and its associated tools, it knows Qt very well and can generate rules for invoking moc, uic, and rcc. As a result, the syntax is very concise and easy to learn.
You can achieve this by adding:
QMAKE_CXXFLAGS += -std=c++11
to your .pro file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With