I made a simple application that uses the Windows Api to creates files and modify their permissions.
I used Visual Studio 2017 to compile and run this application, and it works perfectly fine on my computer. However, if a transfer this executable to a fresh Windows 10 x64 virtual machine, I get the following errors:
The code execution cannot proceed because VCRUNTIME140D.dll was not found. Reinstalling the program may fix this issue.
The same error pops up after clicking OK, except with MSVCP140D.dll
, and then ucrtbased.dll
.
When checking my installed programs, I noticed that I had the Microsoft Visual C++ 2017 Redistributable (x86)
installed, while my VM only had the 2008 version installed. Could this be the reason the .dll
's were missing? Would I have to install this redistributable in my executable?
Edit: Based off the answers provided, the issue is most likely that the respective redistributable is not installed. So I would like to slightly modify my question and ask, how would I go about verifying if this redistributable is installed, and if it ins't, install it myself.
Edit 2: The executable was built in release mode, not debug mode.
Edit 3: I have found the solution. VS was building my release executables with the Multithreaded DLL runtime library, instead of the normal Multithreaded runtime library. This setting may be changed in: Project properties > C/C++ > Code Generation > Runtime Library. For release configuration, select "Multithreaded", for debug configuration select "Multithreaded debug".