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 (typically vc_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.