mercredi 26 juillet 2017

CONFIG += c++11 (still) doesn't work on Linux

I've read several discussion on the topic, some saying that qmake < 3.0 doesn't support the directive correctly. I've just reinstalled Qt 5.9.1 for g++-64, but the problem is still there. Also, I've tried playing with various mkspecs/xxx/xxx.conf files with no luck.

Adding CONFIG += c++11 to a .pro doesn't really add the CXX flag -std=c++11 in the Makefile, so one get the error

error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

when compiling.

I'm working on Linux x64 (an Ubuntu distro), with the last version of Qt libraries (5.9.1). Same project compiles with no errors on Windows with MSVC2015 and MinGw.

It works if I declare QMAKE_CXXFLAGS += -std=c++11 instead of CONFIG += c++11, but it is suggested to use the former declaration, since qmake will automatically deal with CXX flags via CONFIG directive. Awfully, looks like it's not doing so...

Aucun commentaire:

Enregistrer un commentaire