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. 'CONFIG += c++17' does not take an effect in .pro file.

'CONFIG += c++17' does not take an effect in .pro file.

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 3.1k 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by Dmitriano
    #1

    I have

    CONFIG += c++17
    

    in my .pro file, but getting the following compiler errors:

    error C4984: 'if constexpr' is a C++17 language extension
    error C7525: inline variables require at least '/std:c++17'
    

    My QT version 5.13
    Compiler: MSVC 2017.

    J.HilkJ 1 Reply Last reply
    0
    • D Dmitriano

      I have

      CONFIG += c++17
      

      in my .pro file, but getting the following compiler errors:

      error C4984: 'if constexpr' is a C++17 language extension
      error C7525: inline variables require at least '/std:c++17'
      

      My QT version 5.13
      Compiler: MSVC 2017.

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @Dmitriano
      take a look at this bug report
      https://bugreports.qt.io/browse/QTBUG-67527

      seems like c++1z is the way to go.


      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.

      D 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        hi @Dmitriano
        take a look at this bug report
        https://bugreports.qt.io/browse/QTBUG-67527

        seems like c++1z is the way to go.

        D Offline
        D Offline
        Dmitriano
        wrote on last edited by Dmitriano
        #3

        Hi @J.Hilk !
        I do not know exactly what 'c++1z' is, but it has the same effect, there are still the same compiler errors. (I deleted the build directory and did a clean build).

        J.HilkJ 1 Reply Last reply
        0
        • D Dmitriano

          Hi @J.Hilk !
          I do not know exactly what 'c++1z' is, but it has the same effect, there are still the same compiler errors. (I deleted the build directory and did a clean build).

          J.HilkJ Online
          J.HilkJ Online
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Dmitriano did you make a complete rebuild of your project, clean -> qmake -> make?

          Changing the pro file will require a complete recreation


          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.

          D 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Dmitriano did you make a complete rebuild of your project, clean -> qmake -> make?

            Changing the pro file will require a complete recreation

            D Offline
            D Offline
            Dmitriano
            wrote on last edited by
            #5

            @J.Hilk
            yes I replaced

            #CONFIG += c++17
            CONFIG += c++1z
            

            removed the build directory and rebuilt the project.

            J.HilkJ aha_1980A 2 Replies Last reply
            0
            • D Dmitriano

              @J.Hilk
              yes I replaced

              #CONFIG += c++17
              CONFIG += c++1z
              

              removed the build directory and rebuilt the project.

              J.HilkJ Online
              J.HilkJ Online
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @Dmitriano
              well I#m out of ideas,

              according to this reference
              https://doc.qt.io/qt-5/qmake-variable-reference.html

              it should work, if your compiler supports it.
              I would assume, that MSVC2017 does indeed support c++17 😟


              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.

              D 1 Reply Last reply
              0
              • D Dmitriano

                @J.Hilk
                yes I replaced

                #CONFIG += c++17
                CONFIG += c++1z
                

                removed the build directory and rebuilt the project.

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Dmitriano please show your compiler output. Both c++1z and c++17 should work in Qt 5.12 upwards. For version < 5.12, you need to specify c++17.

                Qt has to stay free or it will die.

                1 Reply Last reply
                0
                • J.HilkJ J.Hilk

                  @Dmitriano
                  well I#m out of ideas,

                  according to this reference
                  https://doc.qt.io/qt-5/qmake-variable-reference.html

                  it should work, if your compiler supports it.
                  I would assume, that MSVC2017 does indeed support c++17 😟

                  D Offline
                  D Offline
                  Dmitriano
                  wrote on last edited by Dmitriano
                  #8

                  @J.Hilk @aha_1980
                  Something went wrong after switching from 5.12 to 5.13. Probably I selected a wrong configuration 'VS2017 Desktop 64bit'. If I select 'Desktop Qt 5.13 MSVS2017 64bit' the project compiles.

                  1 Reply Last reply
                  1

                  • Login

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