Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. The flag CONFIG += c++14 is not working
Qt 6.11 is out! See what's new in the release blog

The flag CONFIG += c++14 is not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 313 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KJ92
    wrote on last edited by KJ92
    #1

    I would like to compile my program with c++14 but the flag mentioned in the documentation CONFIG += c++14 is not working.

    To check that i used byte that exist only from c++17. here is my code:

    #include <QCoreApplication>
    using namespace std;
    int main(int argc, char *argv[])
    {
        byte a = byte{2};
        //QCoreApplication a(argc, argv);
       printf("sdsdsds");
        return 0;
    }
    
    

    and my .pro file:

    QT -= gui
    
    QT += core5compat
    
    CONFIG += console
    
    CONFIG += static
    
    CONFIG -= app_bundle
    CONFIG += c++14 
    
    LIBS += -lWindowsApp
    SOURCES += \
            main.cpp
    
    
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    jsulmJ 1 Reply Last reply
    0
    • K KJ92

      I would like to compile my program with c++14 but the flag mentioned in the documentation CONFIG += c++14 is not working.

      To check that i used byte that exist only from c++17. here is my code:

      #include <QCoreApplication>
      using namespace std;
      int main(int argc, char *argv[])
      {
          byte a = byte{2};
          //QCoreApplication a(argc, argv);
         printf("sdsdsds");
          return 0;
      }
      
      

      and my .pro file:

      QT -= gui
      
      QT += core5compat
      
      CONFIG += console
      
      CONFIG += static
      
      CONFIG -= app_bundle
      CONFIG += c++14 
      
      LIBS += -lWindowsApp
      SOURCES += \
              main.cpp
      
      
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @KJ92 What Qt version do you use? Could be that Qt6 requires C++17, so it is always active unless you enable a higher C++ version.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      0
      • jsulmJ jsulm

        @KJ92 What Qt version do you use? Could be that Qt6 requires C++17, so it is always active unless you enable a higher C++ version.

        K Offline
        K Offline
        KJ92
        wrote on last edited by
        #3

        @jsulm I'm using QT6.

        Thought that the requirement of C++17 is only for compiling QT sources.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved