0
votes

I reinstalled Visual Studio 2017 and just couldn't configure a working Kit for Qt.

Summary: At the very beginning, I had both Qt5.9.8 MSVC2017_64bit and Visual Studio 2017 installed on my computer. They just worked fine. Then I updated Visual Studio to 2019 and uninstalled VS2017. Then my Qt Creator broke down. When I try to open a Qt project created before, it just prompts me that "No valid kits found".

What I tried :

  1. I tried to reinstall something 'needed', attempting to restore something for Qt to work. So I opened Visual Studio Installer, checked to install Single Component "VC++ 2017 version 15.9 v14.16 latest v141 tools" of Visual Studio Enterprise 2017. Then I opened Qt Creator 4.8.2, Menu->Tools->Kits, manually added a clang-cl C and C++ compiler and set the compiler path each to "C:\Program Files (x86)\Microsoft Visual Studio\2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe".

  2. I also tried some combinations between Hostx64, Hostx86 and x64, x86 when selecting the path. But none of then succeeded.

Besides, I have heard and taken a shot on Qt VS Tools.

Related environments:

Microsoft Visual Studio 2019 Enterprise

Microsoft Visual Studio 2008 Professional (whose compiler was auto-detected in Qt but not usable)

Qt 5.9.8 MSVC2017_64bit

Question :

Would anyone tell me what I can do to solve this troubling problem?

1

1 Answers

0
votes

cl.exe is not clang, so you will not make it work by forcing cl.exe into a clng configuration in Qt Creator.

As of today, there is no way to set an MSVC compiler toolchain manually in Qt Creator. The only way is to have it auto-detected. If your MSVC toolchain is not detected, the first thing to do is to update Qt Creator (current version is 4.9.2) becaue each released of Qt Creator has improved detection methods for the new MSVC releases.

I know that Microsoft has standardized the way to detect installed toolchains with 2019. So if you use MSVC 2019 + Qt Creator 4.9+, yous should not have any problem.

Note that in the past Qt Creator had issues with:

  • MSVC Build Tools (MSVC toolchain without Visual Studio GUI)
  • Installing old toolchains with new installer e.g. installing MSVC 2015 as part of Vistual Studio 2017 installation.

Also, by default Visual Studio does not install the command line debuger by default. You need to go to "Add and remove programs" and modify the Windows SDK installation by enabling the debug tools.