How to fix vs2022 developer command prompt build a v142 vcxproj

若冲 文 0 Reputation points
2023-06-05T05:17:21.4166667+00:00

For work reason I need to use the command to convert QT pro to vcxproj, with vs2019 the command can convert successfully and create a v142 vcxproj, but it confused when I updata the vs version to vs2022, the command still creat the v142 vcxproj not v143.

The command and resault show bellow.command

.qmake.stash

.vcxproj

I also tried some ways bellow but none of them worked:

uninstall both 2019 and 2022 then only install 2022;

use cmd not vs developer command pormpt, and the use command

"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.36

before convert.

By the way, in a clean vs2022 environment computer(never installed vs2019), the command can convert to v143 vcxproj correctly.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,172 questions
{count} votes

1 answer

Sort by: Most helpful
  1. 若冲 文 0 Reputation points
    2023-06-06T07:41:32.2933333+00:00

    The file .qmake.stash created correctly, it means there's no bug with vs command environment, and something wrong with qmake.

    Maybe there is some easy way to clean qmake cache with 2019 configure, but reinstall QT after installed vs2022 is effective.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.