To summarize my findings, there are four options:
- Provide a link to the MS download page for the VC runtime.
- Add the installer for the VC runtime to your installation.
- Copy msvcr ***. dll to your program directory.
- Compilation with static libraries.
They all seem to work.
(1) or (2) obviously has a problem with different versions of the runtime. We need to trust Microsoft and software developers to ensure compatibility.
(3) There is a problem that the added dll must run on the target machine.
I decided to use (4) because it works. To try this, set /MT in the C ++ → Code Generation properties for your project.
source share