Qt deploy cannot find Visual Studio installation directory

Viewed 2601

I'm having a problem with Qt Deployment:

After a windeployqt App.exe, it returns

Adding Qt5Svg for qsvgicond.dll
Direct dependencies: Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets
All dependencies   : Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets
To be deployed     : Qt5Core Qt5Gui Qt5SerialPort Qt5Svg Qt5Widgets
Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set.

(I have to use the Qt 5.12.2 (MSVC 2017 64-bit) console, in the windows powershell the command windeployqt isn't found).

It doesn't deploy the msvc dll. How can I set VCINSTALLDIR?

Someone can help me? Thanks a lot

2 Answers

For VS2019 Community VCINSTALLDIR is C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC. Add to system variables and restart Visual Studio.

What worked for me was to use VS's command prompt instead of Qt's one. Specifically I had to use VS2017 x64 Native Tools Command Prompt instead of Qt 5.12.12 (MSVC 2017 64-bit), although the precise versions will vary. Using VS's command prompt windeployqt.exe was able to find VC and deploy the correct vcredist_x64.exe.

Related