Qt deploy cannot find Visual Studio installation directory
Asked Answered
N

3

7

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

Natalianatalie answered 24/9, 2020 at 11:49 Comment(9)
can you call "%VS140COMNTOOLS%\vsvars32.bat" before you are doing the windeployqt?Dubbing
No, now I'm executing the bat file Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.batNatalianatalie
But VCINSTALLDIR is not set yetNatalianatalie
The one you are using sets the VSINSTALLDIR but the one that i mention sets the VCINSTALLDIRDubbing
I see "VCINSTALLDIR is not set", but I don't knowNatalianatalie
"%VS140COMNTOOLS%\vsvars32.bat" sets the VCINSTALLDIRDubbing
With VS2019 vsvars32.nbat returns succesful, while with VS2017 (i'm compiling this applicaiton with msvc2017) i didn't see anything.Natalianatalie
on my computer %VS140COMNTOOLS% expands to : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ Can you look in that folder to see if there is a vsvars32.bat?Dubbing
I can find that file in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build, not in your path.Natalianatalie
P
1

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

Panek answered 26/6, 2021 at 14:20 Comment(0)
S
0

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.

Slapdash answered 20/7, 2022 at 12:19 Comment(0)
H
0

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.

Hilbert answered 2/9 at 5:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.