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. can't run QT6 in visual studio 2022

can't run QT6 in visual studio 2022

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 7 Posters 8.8k 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.
  • H Offline
    H Offline
    HerrWinfried
    wrote on 17 Nov 2021, 14:51 last edited by
    #1

    hello, I installed Visual studio 2022, then I installed QT (msvc + mingw), but as I said, I can't run it, it gives all kinds of errors. I brought C++ Build 17 but nothing changed. What exactly should I do while installing?
    It cannot logically find the exe to run because the compilation is not working properly. I tried it in VS 2019 and it was the same on it.

    Build started...
    1>------ Build started: Project: QtWidgetsApplication2, Configuration: Debug x64 ------
    1>QtWidgetsApplication2.cpp
    1>main.cpp
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12,10): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory (compiling source file main.cpp)
    1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12,10): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory (compiling source file QtWidgetsApplication2.cpp)
    1>Done building project "QtWidgetsApplication2.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    857714d4-52ec-455b-adeb-eeb243d475d8-image.png

    A 1 Reply Last reply 17 Nov 2021, 14:57
    0
    • H HerrWinfried
      17 Nov 2021, 14:51

      hello, I installed Visual studio 2022, then I installed QT (msvc + mingw), but as I said, I can't run it, it gives all kinds of errors. I brought C++ Build 17 but nothing changed. What exactly should I do while installing?
      It cannot logically find the exe to run because the compilation is not working properly. I tried it in VS 2019 and it was the same on it.

      Build started...
      1>------ Build started: Project: QtWidgetsApplication2, Configuration: Debug x64 ------
      1>QtWidgetsApplication2.cpp
      1>main.cpp
      1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12,10): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory (compiling source file main.cpp)
      1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12,10): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory (compiling source file QtWidgetsApplication2.cpp)
      1>Done building project "QtWidgetsApplication2.vcxproj" -- FAILED.
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
      

      857714d4-52ec-455b-adeb-eeb243d475d8-image.png

      A Offline
      A Offline
      artwaw
      wrote on 17 Nov 2021, 14:57 last edited by
      #2

      @HerrWinfried Have you installed Windows SDK?

      For more information please re-read.

      Kind Regards,
      Artur

      H 1 Reply Last reply 17 Nov 2021, 15:23
      0
      • A artwaw
        17 Nov 2021, 14:57

        @HerrWinfried Have you installed Windows SDK?

        H Offline
        H Offline
        HerrWinfried
        wrote on 17 Nov 2021, 15:23 last edited by HerrWinfried
        #3

        @artwaw oh yes i downloaded it now. But this time the error has changed.
        353d207f-ef37-457f-90cc-b4c31d3a2688-image.png

        C 1 Reply Last reply 17 Nov 2021, 15:38
        0
        • H HerrWinfried
          17 Nov 2021, 15:23

          @artwaw oh yes i downloaded it now. But this time the error has changed.
          353d207f-ef37-457f-90cc-b4c31d3a2688-image.png

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 17 Nov 2021, 15:38 last edited by
          #4

          @HerrWinfried This is the C++ standard you use. This does not answer @artwaw's question if you properly installed the WindowsSDK. The error you're showing us does not come from Qt but from a missing header file provided by MSVC / WindowsSDK - there is nothing Qt can do against this.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JoeCFD
            wrote on 17 Nov 2021, 15:42 last edited by JoeCFD
            #5

            Qt6 requires c++17. Try the following:
            To set this for a project:

            1. Right click a project, go to Properties
            2. Select Configuration Properties > C/C++ > Language
            3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"
            H 1 Reply Last reply 17 Nov 2021, 15:46
            0
            • J JoeCFD
              17 Nov 2021, 15:42

              Qt6 requires c++17. Try the following:
              To set this for a project:

              1. Right click a project, go to Properties
              2. Select Configuration Properties > C/C++ > Language
              3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"
              H Offline
              H Offline
              HerrWinfried
              wrote on 17 Nov 2021, 15:46 last edited by HerrWinfried
              #6

              @Christian-Ehrlicher said in can't run QT6 in visual studio 2022:

              @HerrWinfried This is the C++ standard you use. This does not answer @artwaw's question if you properly installed the WindowsSDK. The error you're showing us does not come from Qt but from a missing header file provided by MSVC / WindowsSDK - there is nothing Qt can do against this.

              Thanks for the info, I'll upload it again and have a look.
              The strange thing is that I can compile via QT Creator. however, an exclamation point appears next to it on the build screen.
              0cd70701-81ef-4fc9-8f1a-6571788643c4-image.png

              @JoeCFD said in can't run QT6 in visual studio 2022:

              Qt6 requires c++17. Try the following:
              To set this for a project:

              1. Right click a project, go to Properties
              2. Select Configuration Properties > C/C++ > Language
              3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"

              I mentioned it in the image above, it's already set like that. Thanks anyway.

              J J K 3 Replies Last reply 17 Nov 2021, 15:51
              0
              • H HerrWinfried
                17 Nov 2021, 15:46

                @Christian-Ehrlicher said in can't run QT6 in visual studio 2022:

                @HerrWinfried This is the C++ standard you use. This does not answer @artwaw's question if you properly installed the WindowsSDK. The error you're showing us does not come from Qt but from a missing header file provided by MSVC / WindowsSDK - there is nothing Qt can do against this.

                Thanks for the info, I'll upload it again and have a look.
                The strange thing is that I can compile via QT Creator. however, an exclamation point appears next to it on the build screen.
                0cd70701-81ef-4fc9-8f1a-6571788643c4-image.png

                @JoeCFD said in can't run QT6 in visual studio 2022:

                Qt6 requires c++17. Try the following:
                To set this for a project:

                1. Right click a project, go to Properties
                2. Select Configuration Properties > C/C++ > Language
                3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"

                I mentioned it in the image above, it's already set like that. Thanks anyway.

                J Offline
                J Offline
                JoeCFD
                wrote on 17 Nov 2021, 15:51 last edited by JoeCFD
                #7

                @HerrWinfried It might have been added to your project.
                Check your pro file and you may find
                CONFIG += c++17

                if you use cmake, it may have included
                set(CMAKE_CXX_STANDARD 17)

                But I am surprised that vs 2022 does not have c++17 as default

                1 Reply Last reply
                1
                • H HerrWinfried
                  17 Nov 2021, 15:46

                  @Christian-Ehrlicher said in can't run QT6 in visual studio 2022:

                  @HerrWinfried This is the C++ standard you use. This does not answer @artwaw's question if you properly installed the WindowsSDK. The error you're showing us does not come from Qt but from a missing header file provided by MSVC / WindowsSDK - there is nothing Qt can do against this.

                  Thanks for the info, I'll upload it again and have a look.
                  The strange thing is that I can compile via QT Creator. however, an exclamation point appears next to it on the build screen.
                  0cd70701-81ef-4fc9-8f1a-6571788643c4-image.png

                  @JoeCFD said in can't run QT6 in visual studio 2022:

                  Qt6 requires c++17. Try the following:
                  To set this for a project:

                  1. Right click a project, go to Properties
                  2. Select Configuration Properties > C/C++ > Language
                  3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"

                  I mentioned it in the image above, it's already set like that. Thanks anyway.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 18 Nov 2021, 05:54 last edited by
                  #8

                  @HerrWinfried said in can't run QT6 in visual studio 2022:

                  however, an exclamation point appears next to it on the build screen

                  If you put cursor over it: what does it say?

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

                  H 1 Reply Last reply 18 Nov 2021, 07:56
                  0
                  • H HerrWinfried
                    17 Nov 2021, 15:46

                    @Christian-Ehrlicher said in can't run QT6 in visual studio 2022:

                    @HerrWinfried This is the C++ standard you use. This does not answer @artwaw's question if you properly installed the WindowsSDK. The error you're showing us does not come from Qt but from a missing header file provided by MSVC / WindowsSDK - there is nothing Qt can do against this.

                    Thanks for the info, I'll upload it again and have a look.
                    The strange thing is that I can compile via QT Creator. however, an exclamation point appears next to it on the build screen.
                    0cd70701-81ef-4fc9-8f1a-6571788643c4-image.png

                    @JoeCFD said in can't run QT6 in visual studio 2022:

                    Qt6 requires c++17. Try the following:
                    To set this for a project:

                    1. Right click a project, go to Properties
                    2. Select Configuration Properties > C/C++ > Language
                    3. For C++ Language Standard select "ISO C++17 Standard (/std:c++17)"

                    I mentioned it in the image above, it's already set like that. Thanks anyway.

                    K Offline
                    K Offline
                    KroMignon
                    wrote on 18 Nov 2021, 07:40 last edited by
                    #9

                    @HerrWinfried said in can't run QT6 in visual studio 2022:

                    I mentioned it in the image above, it's already set like that. Thanks anyway.

                    Perhaps, but you select an x86 debugger for a amd64 compiler. I don't thing this is valid configuration.

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    1 Reply Last reply
                    0
                    • J jsulm
                      18 Nov 2021, 05:54

                      @HerrWinfried said in can't run QT6 in visual studio 2022:

                      however, an exclamation point appears next to it on the build screen

                      If you put cursor over it: what does it say?

                      H Offline
                      H Offline
                      HerrWinfried
                      wrote on 18 Nov 2021, 07:56 last edited by
                      #10

                      @jsulm said in can't run QT6 in visual studio 2022:

                      @HerrWinfried said in can't run QT6 in visual studio 2022:

                      however, an exclamation point appears next to it on the build screen

                      If you put cursor over it: what does it say?

                      f2a265c0-f2e5-49f9-9296-892133c86b19-image.png

                      @KroMignon said in can't run QT6 in visual studio 2022:

                      @HerrWinfried said in can't run QT6 in visual studio 2022:

                      I mentioned it in the image above, it's already set like that. Thanks anyway.

                      Perhaps, but you select an x86 debugger for a amd64 compiler. I don't thing this is valid configuration.

                      My result did not change when I did x64

                      J 1 Reply Last reply 18 Nov 2021, 09:53
                      0
                      • H HerrWinfried
                        18 Nov 2021, 07:56

                        @jsulm said in can't run QT6 in visual studio 2022:

                        @HerrWinfried said in can't run QT6 in visual studio 2022:

                        however, an exclamation point appears next to it on the build screen

                        If you put cursor over it: what does it say?

                        f2a265c0-f2e5-49f9-9296-892133c86b19-image.png

                        @KroMignon said in can't run QT6 in visual studio 2022:

                        @HerrWinfried said in can't run QT6 in visual studio 2022:

                        I mentioned it in the image above, it's already set like that. Thanks anyway.

                        Perhaps, but you select an x86 debugger for a amd64 compiler. I don't thing this is valid configuration.

                        My result did not change when I did x64

                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 18 Nov 2021, 09:53 last edited by
                        #11

                        @HerrWinfried I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                        You can ask Qt devs on their mailing list.

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

                        K 1 Reply Last reply 18 Nov 2021, 10:04
                        0
                        • J jsulm
                          18 Nov 2021, 09:53

                          @HerrWinfried I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                          You can ask Qt devs on their mailing list.

                          K Offline
                          K Offline
                          KroMignon
                          wrote on 18 Nov 2021, 10:04 last edited by
                          #12

                          @jsulm said in can't run QT6 in visual studio 2022:

                          I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                          You can ask Qt devs on their mailing list.

                          @HerrWinfried

                          Visual Studio 2022 toolchain support/detection has been added into Qt Creator 6.0 (cf release note: https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-6.0.0.md)
                          First RC has been published at 11.11 (cf. https://www.qt.io/blog/qt-creator-6-rc-released)

                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                          H 1 Reply Last reply 18 Nov 2021, 10:09
                          1
                          • K KroMignon
                            18 Nov 2021, 10:04

                            @jsulm said in can't run QT6 in visual studio 2022:

                            I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                            You can ask Qt devs on their mailing list.

                            @HerrWinfried

                            Visual Studio 2022 toolchain support/detection has been added into Qt Creator 6.0 (cf release note: https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-6.0.0.md)
                            First RC has been published at 11.11 (cf. https://www.qt.io/blog/qt-creator-6-rc-released)

                            H Offline
                            H Offline
                            HerrWinfried
                            wrote on 18 Nov 2021, 10:09 last edited by
                            #13

                            @KroMignon said in can't run QT6 in visual studio 2022:

                            @jsulm said in can't run QT6 in visual studio 2022:

                            I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                            You can ask Qt devs on their mailing list.

                            @HerrWinfried

                            Visual Studio 2022 toolchain support/detection has been added into Qt Creator 6.0 (cf release note: https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-6.0.0.md)
                            First RC has been published at 11.11 (cf. https://www.qt.io/blog/qt-creator-6-rc-released)

                            Sounds like something that won't fix my problem in visual studio 2022. Thanks again for the information.

                            J 1 Reply Last reply 18 Nov 2021, 12:52
                            0
                            • H HerrWinfried
                              18 Nov 2021, 10:09

                              @KroMignon said in can't run QT6 in visual studio 2022:

                              @jsulm said in can't run QT6 in visual studio 2022:

                              I guess Qt does not yet support C++ compiler from Visual Studio 2022.
                              You can ask Qt devs on their mailing list.

                              @HerrWinfried

                              Visual Studio 2022 toolchain support/detection has been added into Qt Creator 6.0 (cf release note: https://code.qt.io/cgit/qt-creator/qt-creator.git/plain/dist/changes-6.0.0.md)
                              First RC has been published at 11.11 (cf. https://www.qt.io/blog/qt-creator-6-rc-released)

                              Sounds like something that won't fix my problem in visual studio 2022. Thanks again for the information.

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 18 Nov 2021, 12:52 last edited by
                              #14

                              @HerrWinfried According to https://www.qt.io/blog/qt-vs-tools-for-visual-studio-2022 it should work, but I'm not sure about Qt itself.

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

                              H 1 Reply Last reply 18 Nov 2021, 15:45
                              0
                              • J jsulm
                                18 Nov 2021, 12:52

                                @HerrWinfried According to https://www.qt.io/blog/qt-vs-tools-for-visual-studio-2022 it should work, but I'm not sure about Qt itself.

                                H Offline
                                H Offline
                                HerrWinfried
                                wrote on 18 Nov 2021, 15:45 last edited by
                                #15

                                That's the point that confuses me, but anyway, I prefer to wait a few weeks for now.

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  Greg_Phil
                                  wrote on 3 Jan 2022, 16:11 last edited by
                                  #16

                                  @HerrWinfried
                                  The problem is that VS2022 doesn't return by default the right value for

                                  __cplusplus
                                  

                                  No idea if that's a bug or a feature in VS2022. However, here the solution how to overcome this issue:
                                  https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170

                                  cheers
                                  Greg

                                  1 Reply Last reply
                                  3

                                  • Login

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