Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C++ executable and missing MSVCR100d.dll

I know this has been asked in other places and answered, but I'm having issues with MS Visual Studio 2010. I've developed a C++ executable but if I run the Release version on a machine that doesn't have the VC++ runtime library (ie, msvcr100d.dll), I get the "program cannot start because msvcr100d.dll is missing from your computer" error.

This is weird for two reasons:

  • Why is it trying to link with the debug version of the redistributable?
  • I tried applying this fix, setting the runtime library setting to /MT instead of /MD (multi-threaded DLL), but that only made the problem worse (if I manually copied msvcr100d.dll, it then said it couldn't find msvcp110.dll).

How can I package the runtime library with my executable so that I can run it on machines that don't have MS VC 2010 or the redistributable installed?

I know it's considered a security risk to include a copy of the DLL since it won't ever be updated, but my goal is just to send this executable to a few friends in the short term.

like image 325
mgiuffrida Avatar asked May 02 '12 02:05

mgiuffrida


People also ask

What is msvcr100d DLL?

 msvcr100d. dll is a "debug"-version of the file msvcr100. dll, and is used for "debugging" (software testing) during software development. Normally, debug versions of programs are not meant to be distributed.

Where does msvcr100d DLL go?

Copy the msvcr100. dll file from the \System32\ folder and paste it into the \SysWOW64\ folder. This works if you already have the DLL file in the 32-bit folder (System32) but are having troubles with 64-bit programs accessing it. The full paths of these folders are C:\Windows\System32 and C:\Windows\SysWOW64\.

What is the Msvcr100 DLL problem?

When Installing Examplify, some users may encounter an error message stating that the program cannot be run due to a missing 'Msvcr100. dll'. This message is caused by a missing Windows component not being present on the device.


2 Answers

You definitely should not need the debug version of the CRT if you're compiling in "release" mode. You can tell they're the debug versions of the DLLs because they end with a d.

More to the point, the debug version is not redistributable, so it's not as simple as "packaging" it with your executable, or zipping up those DLLs.

Check to be sure that you're compiling all components of your application in "release" mode, and that you're linking the correct version of the CRT and any other libraries you use (e.g., MFC, ATL, etc.).

You will, of course, require msvcr100.dll (note the absence of the d suffix) and some others if they are not already installed. Direct your friends to download the Visual C++ 2010 Redistributable (or x64), or include this with your application automatically by building an installer.

like image 95
Cody Gray Avatar answered Oct 05 '22 23:10

Cody Gray


For me the problem appeared in this situation:

I installed VS2012 and did not need VS2010 anymore. I wanted to get my computer clean and also removed the VS2010 runtime executables, thinking that no other program would use it. Then I wanted to test my DLL by attaching it to a program (let's call it program X). I got the same error message. I thought that I did something wrong when compiling the DLL. However, the real problem was that I attached the DLL to program X, and program X was compiled in VS2010 with debug info. That is why the error was thrown. I recompiled program X in VS2012, and the error was gone.

like image 38
tmighty Avatar answered Oct 06 '22 01:10

tmighty