Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1655

"Qt requires a C++17 compiler, and a suitable value for __cplusplus" error when building Qbs project with Qt 6.2

    XMLWordPrintable

Details

    • 57bc6d8d9613f257b899fe8b94660142d4f91c07 (qbs/qbs/1.20)

    Description

      Building Slate with Qt 6.2.0 results in this error:

      15:58:42: Running steps for project slate...
      compiling changeimagesizecommand.cpp [lib]
      compiling moc_project.cpp [lib]
      compiling moc_clipboard.cpp [lib]
      compiling animationsystem.cpp [lib]
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\cl.exe /nologo /c /EHsc /Od /Zi /MDd /IC:\dev\slate\lib\3rdparty /IC:\dev\slate\lib /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\vcs-include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtWidgets /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQuick /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQmlModels /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQml /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtOpenGL /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtNetwork /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtGui /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore /IC:\dev\qt-unified\6.2.0\msvc2019_64\mkspecs\win32-msvc /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers /experimental:external /DUNICODE /D_UNICODE /DWIN32 /DSLATE_LIBRARY /DQT_WIDGETS_LIB /DQT_QUICK_LIB /DQT_QMLMODELS_LIB /DQT_QML_LIB /DQT_OPENGL_LIB /DQT_NETWORK_LIB /DQT_GUI_LIB /DQT_CORE_LIB "/DWINVER=0x0502" "/D_WIN32_WINNT=0x0502" "/D_WIN32_WINDOWS=0x0502" /Fdslate.cl.pdb /FoC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\3a52ce780950d4d9\changeimagesizecommand.cpp.obj C:\dev\slate\lib\changeimagesizecommand.cpp /TP /std:c++17 /FS
      C:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore/qglobal.h(94): fatal error C1189: #error:  "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\cl.exe /nologo /c /EHsc /Od /Zi /MDd /IC:\dev\slate\lib\3rdparty /IC:\dev\slate\lib /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\vcs-include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtWidgets /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQuick /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQmlModels /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQml /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtOpenGL /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtNetwork /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtGui /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore /IC:\dev\qt-unified\6.2.0\msvc2019_64\mkspecs\win32-msvc /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers /experimental:external /DUNICODE /D_UNICODE /DWIN32 /DSLATE_LIBRARY /DQT_WIDGETS_LIB /DQT_QUICK_LIB /DQT_QMLMODELS_LIB /DQT_QML_LIB /DQT_OPENGL_LIB /DQT_NETWORK_LIB /DQT_GUI_LIB /DQT_CORE_LIB "/DWINVER=0x0502" "/D_WIN32_WINNT=0x0502" "/D_WIN32_WINDOWS=0x0502" /Fdslate.cl.pdb /FoC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\73489b871e127538\moc_clipboard.cpp.obj C:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers\moc_clipboard.cpp /TP /std:c++17 /FS
      C:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore/qglobal.h(94): fatal error C1189: #error:  "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\cl.exe /nologo /c /EHsc /Od /Zi /MDd /IC:\dev\slate\lib\3rdparty /IC:\dev\slate\lib /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\vcs-include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtWidgets /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQuick /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQmlModels /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQml /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtOpenGL /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtNetwork /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtGui /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore /IC:\dev\qt-unified\6.2.0\msvc2019_64\mkspecs\win32-msvc /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers /experimental:external /DUNICODE /D_UNICODE /DWIN32 /DSLATE_LIBRARY /DQT_WIDGETS_LIB /DQT_QUICK_LIB /DQT_QMLMODELS_LIB /DQT_QML_LIB /DQT_OPENGL_LIB /DQT_NETWORK_LIB /DQT_GUI_LIB /DQT_CORE_LIB "/DWINVER=0x0502" "/D_WIN32_WINNT=0x0502" "/D_WIN32_WINDOWS=0x0502" /Fdslate.cl.pdb /FoC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\73489b871e127538\moc_project.cpp.obj C:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers\moc_project.cpp /TP /std:c++17 /FS
      C:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore/qglobal.h(94): fatal error C1189: #error:  "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\cl.exe /nologo /c /EHsc /Od /Zi /MDd /IC:\dev\slate\lib\3rdparty /IC:\dev\slate\lib /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\vcs-include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtWidgets /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQuick /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQmlModels /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtQml /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtOpenGL /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtNetwork /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtGui /IC:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore /IC:\dev\qt-unified\6.2.0\msvc2019_64\mkspecs\win32-msvc /IC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\qt.headers /experimental:external /DUNICODE /D_UNICODE /DWIN32 /DSLATE_LIBRARY /DQT_WIDGETS_LIB /DQT_QUICK_LIB /DQT_QMLMODELS_LIB /DQT_QML_LIB /DQT_OPENGL_LIB /DQT_NETWORK_LIB /DQT_GUI_LIB /DQT_CORE_LIB "/DWINVER=0x0502" "/D_WIN32_WINNT=0x0502" "/D_WIN32_WINDOWS=0x0502" /Fdslate.cl.pdb /FoC:\dev\slate-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug\Debug_Desktop__1d87629ee6337dc6\lib.9d062baf\3a52ce780950d4d9\animationsystem.cpp.obj C:\dev\slate\lib\animationsystem.cpp /TP /std:c++17 /FS
      C:\dev\qt-unified\6.2.0\msvc2019_64\include\QtCore/qglobal.h(94): fatal error C1189: #error:  "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
      Process failed with exit code 2.
      The following products could not be built for configuration Debug_Desktop__1d87629ee6337dc6:
      app, lib, screenshots, test-app, translations
      Error while building/deploying project slate (kit: Desktop Qt 6.2.0 MSVC2019 64bit)
      When executing step "Qbs Build"
      15:58:42: Elapsed time: 00:01.
      

      A similar error is seen here:

      QTCREATORBUG-25730

      Attachments

        Issue Links

          For Gerrit Dashboard: QBS-1655
          # Subject Branch Project Status CR V

          Activity

            People

              jbornema Joerg Bornemann
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes