how to bundle all the system dll and lib for my qt program?
-
Wrote a simple timer, and when people run it on their computer its missing VCRUNTIME140.dll along with a bunch of others, it is not possible to find them all and mistake could be made if done manually. I want to know if qt provides ways to deploy all required dll and lib with my program? best if I could make it into a installer as well.
-
For VCRUNTIME140.dll, Once go through this link....https://helpdeskgeek.com/how-to-fix-a-vcruntime140-dll-is-missing-error-on-windows-10/.....I don't know if this works, just try it out.....
For other dlls, are those related to qt like, qt related dlls u can find them in qt_folder/qt_version/project_compiler_version/....normally in this path you will find required dlls......
My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project
Hope this helps....
-
For VCRUNTIME140.dll, Once go through this link....https://helpdeskgeek.com/how-to-fix-a-vcruntime140-dll-is-missing-error-on-windows-10/.....I don't know if this works, just try it out.....
For other dlls, are those related to qt like, qt related dlls u can find them in qt_folder/qt_version/project_compiler_version/....normally in this path you will find required dlls......
My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project
Hope this helps....
@Jyothi said in how to bundle all the system dll and lib for my qt program?:
My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project
Hope this helps....
... or simply use windeployqt
-
@Jyothi said in how to bundle all the system dll and lib for my qt program?:
My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project
Hope this helps....
... or simply use windeployqt
@Christian-Ehrlicher To add to this: if you use cmake you can find the correct approach here https://www.qt.io/blog/cmake-deployment-api
-
That specific missing file (along with other things is comes with) should be installed using the Microsoft runtime installer available here: Latest Microsoft Visual C++ Redistributable Version rather than reinventing that particular wheel.
-
You can use windeployqt to identify the dependencies and wrap it together and create a zip2exe installation package out of it .
Please refer
https://doc.qt.io/qt-6/windows-deployment.html -
Hi @MonkeyBusiness,
I want to know if qt provides ways to deploy all required dll and lib with my program?
As others have said, the answer is yes. You can read more about it here: https://doc.qt.io/qt-6/windows-deployment.html
Since you asked specifically about
VCRUNTIME140.dll
it's worth explaining a bit more.windeployqt
will collect a few different things for you application (not an exhaustive list):- the Qt libraries your application depends on (if they can be detected);
- the Qt plugins in your application depends on (if they can be detected);
- the VC runtime redistributable.
Now, the
VCRUNTIME140.dll
you mentioned is part of that #3. Specifically, as I understand it, Microsoft does not allow applications to distribute and install VC runtimes in any way other than via their own.exe
installer. So,windeployqt
will pull the VC redist installer (typicallyvc_redist.x64.exe
) from the OS, and put it with your application (unless you use the--no-compiler-runtime
option to skip it). It is then your responsibility to run that installer, if the required runtime is not already installed, either manually, or as part of your own application installer.Here's a bit of how the Qt6 docs describe it:
For Windows desktop applications, the required runtime files for the compiler are also copied to the deployable folder by default (unless the option
--no-compiler-runtime
is specified). In the case of release builds using Microsoft Visual C++, these consist of the Visual C++ Redistributable Packages, which are intended for recursive installation by the application's installer on the target machine.So, in summary:
- use
windeployqt
to collect the libraries, and runtime, needed for the app (tip: you might find--release
and--compiler-runtime
options helpful) - distribute the resulting file set however you like (zip it, write a Qt Installer Framework installer, create an
*.msi
file, etc) - when/after installing, run the included
vc_redist.x64.exe
- either manually, or via your own installer.
There are other ways to do it (including commercial install tools etc), but that's the most basic way, as far as I understand it.
Cheers.