-1

When I open the .exe file of my Visual Studio C++ project (C++ CLR project) in another computer(that probably doesn't have VS), I get this error:

The program can't start because MSVCR120D.dll is missing from your computer. Try reinstalling the program to fix this problem.

Can you help me how can I solve it that my program can be opened in other computers?

  • 1
    You need to install Microsoft C++ Redistributable 2013. Or any higher version. – Tomasz Plaskota Jan 03 '17 at 10:32
  • @TomaszPlaskota in my computer or the computer that is opening my file? – Ali Mahdavifar Jan 03 '17 at 10:33
  • Target machine. These packages conatin all necessary .dll's for running msvs projects. – Tomasz Plaskota Jan 03 '17 at 10:34
  • @TomaszPlaskota Is not there any way that I solve the error from my side? – Ali Mahdavifar Jan 03 '17 at 10:37
  • 1
    You could for example create an installer that would add required dlls to right directory, or installer that would require user to install redist package. If this doesn't fit you either then you could potentially statically link to that lib. [Here](http://stackoverflow.com/a/24728400/6313992) it is explained how. – Tomasz Plaskota Jan 03 '17 at 10:43
  • Possible duplicate of [VS2012 MSVCR120D.dll is missing](http://stackoverflow.com/questions/23114427/vs2012-msvcr120d-dll-is-missing) – tambre Jan 03 '17 at 11:04
  • Your exe is missing a dependency on target computer. Whenever such error occurs use [depends.exe](http://www.dependencywalker.com/) to identify all the dependencies. – sameerkn Jan 03 '17 at 12:12
  • `MSVCR120D` looks like the debug version of the C runtime, you should build a release version of your program if you want to distribute it – Karsten Koop Jan 03 '17 at 13:02
  • @TomaszPlaskota: The redistributable package only contains MSVCR120.dll, which is the release version. – MSalters Jan 03 '17 at 13:35
  • Send the other computer the release version, not the debug. If you want the other user to debug then also install Visual Studio on that computer. MSVCR120D.dll cannot be legally transfered on is own. It is part of Visual Studio as a whole. – rlam12 Jan 03 '17 at 14:09
  • @MSalters ye my bad, I've just looked at version 12 and suggested respective package. Must've been still sleepy :) – Tomasz Plaskota Jan 03 '17 at 14:26

1 Answers1

1

You must create a Release build. Your problem is caused by copying over a Debug build, but that build is intended for the Visual Studio Debugger.

MSalters
  • 173,980
  • 10
  • 155
  • 350