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. I can't build project in Visual Studio 2022
Forum Update on Monday, May 27th 2025

I can't build project in Visual Studio 2022

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
10 Posts 5 Posters 1.4k 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.
  • T Offline
    T Offline
    Techttv
    wrote on last edited by
    #1

    Hi,
    I can't build the project even when I just created it.
    I did these steps:
    I install Qt Creator and Designer, installed Qt extensions for Visual Studio 2022, added the version from the creator (6.8.0) and just created a new Widget Application inside VS2022.
    When I build I get this error:

       Qt/MSBuild: 3.3.0.13
      Reading Qt configuration (C:/Qt/6.8.0/mingw_64/bin/qmake)
    QtWidgetsApplication2.vcxproj : error : ERROR running qmake: "C:/Qt/6.8.0/mingw_64/bin/qmake"  -tp vc -early "CONFIG -= debug release debug_and_release" "CONFIG += debug warn_off"  qtvars.pro
    QtWidgetsApplication2.vcxproj : error : qmake: (C:/Qt/6.8.0/mingw_64/bin/qmake)
    QtWidgetsApplication2.vcxproj : error : qmake: $PWD=C:\Users\tomma\source\repos\QtWidgetsApplication2\QtWidget.3FC3C3D6\x64\Debug\qt\qmake
    QtWidgetsApplication2.vcxproj : error : qmake: Project ERROR: Cannot run compiler 'g++'. Output:
    QtWidgetsApplication2.vcxproj : error : qmake: ===================
    QtWidgetsApplication2.vcxproj : error : qmake: ===================
    QtWidgetsApplication2.vcxproj : error : qmake: Maybe you forgot to setup the environment?
    QtWidgetsApplication2.vcxproj : error : qmake: Error creating .vcxproj file
    
    
    JonBJ 1 Reply Last reply
    0
    • T Offline
      T Offline
      Techttv
      wrote on last edited by
      #7

      EDIT: I SOLVED

      I solved following this video. The error was with the version in use, in fact I was using the MinGW version of Qt. I opened the maintenance tool of Qt and installed the msvc version, then I added it to the visual studio Qt Version selector.

      Christian EhrlicherC 1 Reply Last reply
      0
      • T Techttv

        Hi,
        I can't build the project even when I just created it.
        I did these steps:
        I install Qt Creator and Designer, installed Qt extensions for Visual Studio 2022, added the version from the creator (6.8.0) and just created a new Widget Application inside VS2022.
        When I build I get this error:

           Qt/MSBuild: 3.3.0.13
          Reading Qt configuration (C:/Qt/6.8.0/mingw_64/bin/qmake)
        QtWidgetsApplication2.vcxproj : error : ERROR running qmake: "C:/Qt/6.8.0/mingw_64/bin/qmake"  -tp vc -early "CONFIG -= debug release debug_and_release" "CONFIG += debug warn_off"  qtvars.pro
        QtWidgetsApplication2.vcxproj : error : qmake: (C:/Qt/6.8.0/mingw_64/bin/qmake)
        QtWidgetsApplication2.vcxproj : error : qmake: $PWD=C:\Users\tomma\source\repos\QtWidgetsApplication2\QtWidget.3FC3C3D6\x64\Debug\qt\qmake
        QtWidgetsApplication2.vcxproj : error : qmake: Project ERROR: Cannot run compiler 'g++'. Output:
        QtWidgetsApplication2.vcxproj : error : qmake: ===================
        QtWidgetsApplication2.vcxproj : error : qmake: ===================
        QtWidgetsApplication2.vcxproj : error : qmake: Maybe you forgot to setup the environment?
        QtWidgetsApplication2.vcxproj : error : qmake: Error creating .vcxproj file
        
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @Techttv said in I can't build project in Visual Studio 2022:

        installed Qt extensions for Visual Studio 2022

        Although I don't use Windows/Visual Studio or know what "Qt extensions for Visual Studio 2022" are, you are using MinGW/gcc/g++ for your compiler. Doesn't anything VS2022 require you to use the MSVC compiler?

        If I am wrong about that, and it does allow MinGW, then something is wrong about how you have set up the environment to use MInGW/g++.

        JoeCFDJ 1 Reply Last reply
        0
        • O Offline
          O Offline
          ollarch
          wrote on last edited by
          #3

          Have you installed the Qt for MSVC or only for MinGW/g++ ? If you want to use Visual Studio 2022 with MSVC compiler you have to install the MSVC version of Qt.

          1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
          • JonBJ JonB

            @Techttv said in I can't build project in Visual Studio 2022:

            installed Qt extensions for Visual Studio 2022

            Although I don't use Windows/Visual Studio or know what "Qt extensions for Visual Studio 2022" are, you are using MinGW/gcc/g++ for your compiler. Doesn't anything VS2022 require you to use the MSVC compiler?

            If I am wrong about that, and it does allow MinGW, then something is wrong about how you have set up the environment to use MInGW/g++.

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #4

            @JonB Qt extensions for Visual Studio 2022 is a plugin for VS to create Qt projects and compile Qt code within VS. If VS is available, I guess MinGW/gcc/g++ is not needed.

            JoeCFDJ 1 Reply Last reply
            0
            • JoeCFDJ JoeCFD

              @JonB Qt extensions for Visual Studio 2022 is a plugin for VS to create Qt projects and compile Qt code within VS. If VS is available, I guess MinGW/gcc/g++ is not needed.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #5

              @JoeCFD Actually, VS can be applied for MinDW projects as well. I did not know this before.

              Configure the Project for MinGW in VS:

              Right-click on your project in the Solution Explorer and select Properties.
              Under Configuration Properties, change the Platform Toolset to use MinGW. If it’s not listed, you might need to manually set the compiler path.
              
              Go to C/C++ > General and set the Additional Include Directories to point to the MinGW include path.
              
              1 Reply Last reply
              1
              • T Offline
                T Offline
                Techttv
                wrote on last edited by
                #6

                Sorry but where I can check the compiler I'm actually using? Because on Qt Project settings it says "6.8.0_mingw_64" but on the version selector it says compiler msvc and it's grayed out.
                QtWidgetsApplication2 - Microsoft Visual Studio 25_10_2024 14_35_26.png

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Techttv
                  wrote on last edited by
                  #7

                  EDIT: I SOLVED

                  I solved following this video. The error was with the version in use, in fact I was using the MinGW version of Qt. I opened the maintenance tool of Qt and installed the msvc version, then I added it to the visual studio Qt Version selector.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • T Techttv has marked this topic as solved on
                  • T Techttv

                    EDIT: I SOLVED

                    I solved following this video. The error was with the version in use, in fact I was using the MinGW version of Qt. I opened the maintenance tool of Qt and installed the msvc version, then I added it to the visual studio Qt Version selector.

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @Techttv Not that this was told you two days ago...

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

                    T 1 Reply Last reply
                    1
                    • Christian EhrlicherC Christian Ehrlicher

                      @Techttv Not that this was told you two days ago...

                      T Offline
                      T Offline
                      Techttv
                      wrote on last edited by
                      #9

                      @Christian-Ehrlicher yeah thanks but I didn't know where to download the msvc version.

                      Christian EhrlicherC 1 Reply Last reply
                      0
                      • T Techttv

                        @Christian-Ehrlicher yeah thanks but I didn't know where to download the msvc version.

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        @Techttv said in I can't build project in Visual Studio 2022:

                        ut I didn't know where to download the msvc version.

                        With the same tool as the MinGW version.

                        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
                        1

                        • Login

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