At some point, Debug stopped running in the studio with the message:

The program cannot be started because MSVCP140D.dll is missing on the computer. Try reinstalling the program.

If you add the path C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\debug_nonredist\x86\Microsoft.VC140.DebugCRT in Debugging - Environment - PATH , then it starts normally. Previously, this was not required. What could break?

UPD

I tried to create a new empty console project, the same situation.

UPD

Debug version with static runtime (as suggested in the Duracell comments) is expected to start normally. But Release works with both a statically linked runtime and dll.

  • If I understand your problem correctly - it is corrected like this - settings of the project-> c \ c ++ -> code creation-> runtime library == multi-threaded mt \ d - Duracell
  • one
    @Duracell, yes, in this version it is launched, but this is rather not a fix, but a concealment of the problem, since All the same, I would like to have runtime not with exe. - Vladimir Gamalyan
  • The installer of the 2015 studio seemed to have a “fix installation” mode. - VladD
  • Did it stop running on just one project, or on a new, clean project, too? (And yes, is there an MSVCP140D.dll file on your computer?) - VladD
  • 3
    Thank you all, I restored the installation through the installer (so as not to guess what other files were missing), the flight is normal. - Vladimir Gamalyan

1 answer 1

Summarizing the investigation and dialogue in the comments:

The msvcp140d.dll library is part of Visual C ++, this is a debug version of the C ++ runtime library and is installed when you install Visual Studio on your computer. It is usually found in %WINDIR%\System32 for 32-bit systems and in %WINDIR%\SysWOW64 for 64-bit systems (for 32-bit programs). Since this is a more or less accessible place, the library may unintentionally delete some other application, which seems to have happened.

The library version is located in <каталог Visual Studio>\VC\redist\debug_nonredist\x86\Microsoft.VC140.DebugCRT , and can be copied from there. But the best solution is to use the repair option of the Visual Studio installer, which will deliver the missing files.


Note that the debug version of the msvcp140d.dll library (as opposed to the release msvcp140.dll ) is not part of redistributable. Therefore, if you want to deploy components on a client machine that require a debug version of runtime, it is best to either build up statically or drag a copy of files from Microsoft.VC140.DebugCRT with you in the installation directory.

Additional information on MSDN: Preparing a Test Machine to Run a Debug Executable .