I can't build project in Visual Studio 2022
-
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
-
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.
-
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
@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++.
-
C Christian Ehrlicher moved this topic from General and Desktop on
-
@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++.
-
@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.
@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.
-
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.
-
-
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.
@Techttv Not that this was told you two days ago...
-
@Techttv Not that this was told you two days ago...
@Christian-Ehrlicher yeah thanks but I didn't know where to download the msvc version.
-
@Christian-Ehrlicher yeah thanks but I didn't know where to download the msvc version.
@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.