Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Helpful msg "...requires a C++17...On MSVC, pass the /Zc:__cplusplus" but no clue HOW to do that
Forum Updated to NodeBB v4.3 + New Features

Helpful msg "...requires a C++17...On MSVC, pass the /Zc:__cplusplus" but no clue HOW to do that

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 4 Posters 1.5k Views 2 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.
  • B Offline
    B Offline
    BillyS
    wrote on 20 Apr 2024, 15:15 last edited by
    #1

    the error message from qglobal.h was "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."

    So, do these settings go into the Cmakelist file, or a header, or do i make default settings in microsoft visual studio, or what? I'm happy to comply. JUST TELL ME HOW. Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Apr 2024, 18:42 last edited by
      #2

      Hi,

      Which version of Visual Studio are you using ?
      With which version of Qt ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply 27 Apr 2024, 13:51
      0
      • S Offline
        S Offline
        SamiV123
        wrote on 21 Apr 2024, 07:05 last edited by
        #3

        set(CMAKE_CXX_STANDARD 17)

        B 1 Reply Last reply 28 Apr 2024, 10:35
        0
        • S SGaist
          20 Apr 2024, 18:42

          Hi,

          Which version of Visual Studio are you using ?
          With which version of Qt ?

          B Offline
          B Offline
          BillyS
          wrote on 27 Apr 2024, 13:51 last edited by
          #4

          @SGaist I HAVE Visual Studio 2022 and 2019. 22 is Enterprise; 19 Pro and Community.
          Qt6.7 .

          1 Reply Last reply
          0
          • S SamiV123
            21 Apr 2024, 07:05

            set(CMAKE_CXX_STANDARD 17)

            B Offline
            B Offline
            BillyS
            wrote on 28 Apr 2024, 10:35 last edited by
            #5

            @SamiV123 Thank you. I believe this is just what i needed.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sprezzatura
              wrote on 13 Dec 2024, 21:00 last edited by
              #6

              I'm using Qt 6, MSVC 2022, qmake. I had to add this to the .PRO file:

              QMAKE_CFLAGS += -std:c++17
              QMAKE_CFLAGS += -Zc:__cplusplus
              
              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