Configuring VC2022 compiler in Qt Creator - _MSC_VER not set
-
I'd like to compile my Qt 6 projects with MSVC2022 compiler. Qt Creator didn't auto-detect the compiler, so I added it manually.
I copied the entries from MSVC2019 (4 entries for C, 4 for C++), gave them new names (e.g. "Microsoft Visual C++ Compiler 19.34.31937 (amd64)"), specified the correct path to vcvarsall.bat. ABI was then auto-detected, and I specified the subtype ("amd64" in this case).
No red or yellow flags showed, so I thought I was good.I then created a new Kit for Qt 6.4.2 using these compilers (same setting as the auto-generated kit for 6.4.2 using MSVC2019, just replacing the compilers and making sure the qmake path was correct).
Then I switched my (cmake) project to the new kit, by deleting the .user file setting it up anew.
And got the following error when trying to rebuild:Unexpected compiler version, expected MSVC 19.34 or newer.
From my understanding, this information should be set from vcvarsall.bat as specified in the compiler setup.
What could have gone wrong?EDIT: Correction: There is an auto-detected version of the MSVC2022 compiler (although the version number doesn't match what cl.exe outputs, but version numbers for MSVC are a topic on their own).
Regardless, I tries using the auto-detected compiler in my Qt kit, but the error is the same. -
I'd like to compile my Qt 6 projects with MSVC2022 compiler. Qt Creator didn't auto-detect the compiler, so I added it manually.
I copied the entries from MSVC2019 (4 entries for C, 4 for C++), gave them new names (e.g. "Microsoft Visual C++ Compiler 19.34.31937 (amd64)"), specified the correct path to vcvarsall.bat. ABI was then auto-detected, and I specified the subtype ("amd64" in this case).
No red or yellow flags showed, so I thought I was good.I then created a new Kit for Qt 6.4.2 using these compilers (same setting as the auto-generated kit for 6.4.2 using MSVC2019, just replacing the compilers and making sure the qmake path was correct).
Then I switched my (cmake) project to the new kit, by deleting the .user file setting it up anew.
And got the following error when trying to rebuild:Unexpected compiler version, expected MSVC 19.34 or newer.
From my understanding, this information should be set from vcvarsall.bat as specified in the compiler setup.
What could have gone wrong?EDIT: Correction: There is an auto-detected version of the MSVC2022 compiler (although the version number doesn't match what cl.exe outputs, but version numbers for MSVC are a topic on their own).
Regardless, I tries using the auto-detected compiler in my Qt kit, but the error is the same.@Asperamanca
So....using an existing build folder from a different kit, and expecting "Clean" to handle it is not a good idea.
Either use a different build folder, or manually delete all content. -
@Asperamanca have you solved the issue?
-
@Asperamanca have you solved the issue?
@ortiz47
Yes, by completely cleaning the contents of the build folder. "Clean project" is not enough.