Maintenance Tool not showing MSVC 2022 64-bit
-
Hi,
I installed Visual Studio 2022 along with the latest compiler. Currently within QtCreator the lastest compiler version I'm using is MSVC2019-64bits. There is no selection in the maintenance tool to install 2022 compiler support libraries. I think there is a way to install a custom compiler, but MSVC is pretty popular so I don't consider it custom. Any ideas how I can get QtCreator to use the 2022 compiler?
Thanks!
-
Seems according to another thread, it is not available so I'm stuck with 2019 for now.
-
You are confusing the compiler you're using in a kit for your app with the compiler that was used to build Qt libraries. The precompiled Qt libraries that are distributed via installer are compiled with VS2019. This doesn't mean you are limited to the same in your app. You can make a kit that uses VS2022 compiler with the VS2019 Qt libraries. They are binary compatible so no problem there.
You don't need to set any custom compilers in Qt Creator. VS2022 is auto-detected by Qt Creator. All you have to do is make a kit that uses your 2019 Qt libs and VS2022 compiler.
Go to Edit -> Preferences -> Kits. On the Compilers tab you should see the VS2022 compiler auto-detected and listed already. On the Qt Versions tab you should see your VS2019 Qt libraries auto-detected. On the Kits tab there's gonna be an auto generated kit for VS2019 compiler and Qt libs. Select it and press the Clone button. Select the new kit and in its properties change the C and C++ compilers to the VS2022. Now you can use that kit for your projects.
Also, if you don't mind compiling Qt yourself, you can download the Qt source in the installer and compile it with VS2022, to crate a fully VS2022 kit. There's no big benefit to that though.
EDIT From what I see you don't even have to make that cloned kit. The auto-generated one will already select the VS2022 compiler for you, so you are good to go without doing anything.
-
@leinad It's just a name auto-generated from the Qt library name. If you select this kit you can change the name to whatever you want in properties. The important thing is what is selected in the C/C++ Compiler fields below.
-
@leinad That should work, but like I said - you don't even have to do that. The auto-generated kit should already use the VS2022 compiler. Here's a screenshot from my setup. This uses The VS2022 compiler and Qt library compiled with VS2019.