Run Qt Executable on Windows 11 - missing vcruntime140_app.dll
-
Hello!
I have developed a program, which is created on Windows 11 by Qt Creator.
Current Settings is Qt 5.15.1 64 bit MSVC 2019, but i can vary this, eg. to MSVC 2015.Out of the devenv, debug and release build is running stable.
As soon as i want to start the .exe out of the release folder, I get errors of missing VC Runtime dlls.- VCRUNTIME140_APP.dll - VCRUNTIME140_1_APP.dll - MSVCP140_APP.dll - MSVCP140_1_APP.dll
I have installed most of the VC Runtimes along with VS 2015, 2017 and 2019.
How can I link these dlls out of QtCreator or where can I get the official dlls to execute the standalone application?
best regards, kevin
-
@kevin_d
your using MSVC so your target computer needs to have a compatibleMicrosoft Visual C++ Redistributable
installed.you get that directly from windows
https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170if that installed, missing dlls like
- VCRUNTIME140_APP.dll
- VCRUNTIME140_1_APP.dll
- MSVCP140_APP.dll
- MSVCP140_1_APP.dll
won't be a problem any more
-
Hello!
Have you tried to put these components inside the application directory? Also, I would recommend to use
Dependencies
(https://github.com/lucasg/Dependencies) orDependency Walker
(http://www.dependencywalker.com/) to check for the missing libraries in such case. -
You can use the local deployment described at https://docs.microsoft.com/en-us/cpp/windows/deployment-in-visual-cpp?view=msvc-170
This means you just have to copy the dlls alongside your executable.
-
HI!
The mentioned dlls were clearly dependencies of necessary Qt libraries.
I added the path to Qt5/bin to my runtime-environment and now the application starts without an error:SET BASE_DIR=C:\Qt\5.15.1\msvc2019_64 SET PATH=%BASE_DIR%\bin;%PATH% application.exe %*
The problem is that I cannot require the user to install Qt5 for executing my program, so what do I need in advance to deploy my application without additional installation, eg: standalone?
Help is very appreciated.
-
@kevin_d You should take a look at https://doc.qt.io/qt-5/windows-deployment.html
You can use that windeployqt to create a folder containing your app and all needed Qt libs and plug-ins. -
Thanks! A simple call:
windeployqt.exe --release "C:\build_directory\release"
did the trick.
I have a lot of files copied and the size of the deployment changed significantly, but now it works when starting the executable directly.best regard
~ solved