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. QT requires C++17 error
Forum Updated to NodeBB v4.3 + New Features

QT requires C++17 error

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 2.9k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on 29 Nov 2022, 19:02 last edited by
    #1

    Prior to using g 6.5.0 I have added this to my main .pro file ,
    and now I am getting this error "QT requires C++17"

    CONFIG += c++17

    I am getting multiples of such errors - QT requires C++17

    Do I have to add CONFIG += c++17 to each sub-project .pro file ?

    Or what else do I have to do ?

    J 1 Reply Last reply 30 Nov 2022, 07:36
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 30 Nov 2022, 07:30 last edited by
      #2

      Qt 6 qmake enables C++17 by default and Qt 5 did not. Hence, under Qt 5 if you wanted to use C++17 language features in your code you needed to deliberately set this in CONFIG. You can still set this in a Qt 6 project file but it will have no impact.

      Your problem lies elsewhere. Since you do not share your project, compiler, platform, or the exact error message(s) it is difficult to say anything else.

      1 Reply Last reply
      1
      • A Anonymous_Banned275
        29 Nov 2022, 19:02

        Prior to using g 6.5.0 I have added this to my main .pro file ,
        and now I am getting this error "QT requires C++17"

        CONFIG += c++17

        I am getting multiples of such errors - QT requires C++17

        Do I have to add CONFIG += c++17 to each sub-project .pro file ?

        Or what else do I have to do ?

        J Offline
        J Offline
        J.Hilk
        Moderators
        wrote on 30 Nov 2022, 07:36 last edited by
        #3

        @AnneRanch said in QT requires C++17 error:

        Do I have to add CONFIG += c++17 to each sub-project .pro file ?

        yes, or create a .qmake-conf for your overall project.

        That conf file is searched by each project file recursively in the parent directories. So place it in the top most folder of your project


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        1

        1/3

        29 Nov 2022, 19:02

        • Login

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