Some crazy things are happening and I don't know what to do (Qt Creator / QMake).
-
Hi guys,
sorry for the title but I even don't know how to describe what is happening in one sentence.
So, I have a Qt project that I am compiling on Ubuntu and on Mint. On Ubuntu it is compiling fine on Mint I get this error "‘if constexpr’ only available with -std=c++17 or -std=gnu++17"
I've always used such configuration to get c++17 support:
TEMPLATE = app
CONFIG += console c++17
CONFIG -= app_bundle
CONFIG -= qtbut somehow my Mint QtCreator does not accept it. Now, what is "funny" is I have exactly the same versions of QtCreator
I've looked at QMake file and I've found the problem:
Here is version from Ubuntu:
and here is from Mint:
See the difference? Even though qmake is at the same version for both systems, the one on mint was compiled with Qt 5.9.5! How this is possible? How can I fix this?
Thanks for any help.
-
@Wodzu said in Some crazy things are happening and I don't know what to do (Qt Creator / QMake).:
Even though qmake is at the same version for both systems, the one on mint was compiled with Qt 5.9.5! How this is possible? How can I fix this?
Are you using Qt 5.9 on Mint?
The easiest solution to your problem would be to use
CONFIG+=c++1z
insteadCONFIG+=c++17
The latter was introduced in Qt 5.12, the former exists some time longer.Regards
Edit:
sorry for the title but I even don't know how to describe what is happening in one sentence.
How about:
Cannot enable C++17 on Linux Mint but it is working on Ubuntu
? -
Are you using Qt 5.9 on Mint?
According to system information I am using Qt 5.13.1, but I remember uninstalling older version of Qt Creator and all its dependencies. Maybe it did not uninstall correctly and it did not remove qmake and it is pointing to the old version of qmake?
The easiest solution to your problem would be to use
CONFIG+=c++1z
insteadCONFIG+=c++17
The latter was introduced in Qt 5.12, the former exists some time longer.I've found out that solution but I would prefer to have exact installations to avoid further problems that I am not aware right now.