10
votes

What are the difference between these two dlls vcruntime140.dll and vcruntime140d.dll? Why do we need them? Are they both part of the Microsoft Visual C++ 2015 Redistributable?

Have googled for quite some time, but couldn't find anything that I can understand.

Some background: I have a C# program that works on a Windows 10 machine but doesn't work on Windows Vista, and looks like it is because there is no vcruntime140d.dll on my Windows Vista machine.

1
The vcruntime140.dll is the release version - you must use it with a project built with release settings. The vcruntime140d.dll is the debug version - you must use it with a project built with debug settings. - Jerry Jeremiah
D versions are generally not redistributable... - Alexei Levenkov
@JerryJeremiah Thank you, that is right to the point, turn out that I distributed my app with debug build. Please write that as an answer so that I can accept. - Bon
@AlexeiLevenkov thanks, so I have the d version because I installed visual studio? - Bon
@Bon yes. You should be compiling release build to distribute. - Alexei Levenkov

1 Answers

19
votes

Although I couldn't find anything authoritative on Microsoft's site, they have always shipped two of each DLL:

  • a release version which does NOT end with a d - for example: vcruntime140.dll
  • a debug version which ends with a d - for example: vcruntime140d.dll

You need to use the right one because the library that the compiler uses is picked based on whether the project is built with debug or release settings. So if you compile with release settings the executable will use vcruntime140.dll and if you compile with debug settings the executable will use vcruntime140d.dll