Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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 -= qt

    but somehow my Mint QtCreator does not accept it. Now, what is "funny" is I have exactly the same versions of QtCreator

    3d8ec4eb-4c9c-47ab-b321-d47e55700d08-image.png

    I've looked at QMake file and I've found the problem:

    Here is version from Ubuntu:

    172d14ca-b269-484b-9178-b58106eaceac-image.png

    and here is from Mint:

    6293c2ad-660d-454e-b9b7-4e9a35081ffb-image.png

    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.


  • Lifetime Qt Champion

    @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 instead CONFIG+=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 instead CONFIG+=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.



  • Are you using Qt 5.9 on Mint?

    Hmm, it looks like I am using it:

    efdbbd50-73b3-463a-9efb-d253c9002276-image.png

    How can I upgrade?



  • I was able to update Qt, thanks for helping me out.


Log in to reply