Cenziii
Cenziii

Reputation: 111

Qt deploy cannot find Visual Studio installation directory

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

Upvotes: 7

Views: 5591

Answers (3)

JoeJoe909
JoeJoe909

Reputation: 41

You may have an environment variable path set for Visual Studio only. What you need to do is add a path to your Qt\6.x.x\mingw_64\bin directory where that particular windeploy.exe exists. Set that in your path above your VS path and you should be good to go.

Upvotes: 0

Rodriguez
Rodriguez

Reputation: 236

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.

Upvotes: 0

Oleg Z
Oleg Z

Reputation: 36

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

Upvotes: 1

Related Questions