Visual C++ executable and missing MSVCR100d.dll
Asked Answered
P

6

38

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.

Pelops answered 2/5, 2012 at 2:4 Comment(4)
What do you mean by using the /MT setting made things worse? That should remove the dependency on the DLL runtime. Does your project depend on other DLLs? They might be what is improperly depending on the debug runtime. A utility like Dependency Walker can help you figure out if that's the case: dependencywalker.comConvalesce
@eli: I don't think people really care much about the security risk when they tell you not to redistribute the DLL, since you can link statically anyway. It's more of a licensing issue than anything else.Nakano
@MichaelBurr Dependency Walker confirmed that one of the DLLs my project depends on does depend on msvcr100d.dll. Turns out that DLL wasn't building in Release mode. Thanks.Pelops
Just because of this problem, I shifted my project to VS 2008 and Win 7 already had its prerequisite dlls.Particularly
I
43

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.

Invar answered 2/5, 2012 at 2:13 Comment(5)
installing Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) worked great for me!Outstretch
@Outstretch that should only apply to the release version since (as Cody Gray mentioned) debug versions are usually not redistributable. If you don't have MSVC2010 installed, msvcr100d.dll should still be missing.Gravure
Those links no longer work :-/Alic
Google for the name, @Ignorante. It's trivial to find them.Invar
Well, I did find them, but not in microsoft site. Apparently they no longer have them there. That's why I commented.Alic
H
2

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.

Hinds answered 20/11, 2013 at 10:2 Comment(0)
G
2

This problem explained in MSDN Library and as I understand installing Microsoft's Redistributable Package can help.

But sometimes the following solution can be used (as developer's side solution):

In your Visual Studio, open Project properties -> Configuration properties -> C/C++ -> Code generation and change option Runtime Library to /MT instead of /MD

Grope answered 28/4, 2015 at 13:4 Comment(0)
C
1

Usually the application that misses the .dll indicates what version you need – if one does not work, simply download the Microsoft visual C++ 2010 x86 or x64 from this link:

For 32 bit OS:Here

For 64 bit OS:Here

Crt answered 10/7, 2013 at 17:24 Comment(0)
B
1

I got the same error.

I was refering a VS2010 DLL in a VS2012 project.

Just recompiled the DLL on VS2012 and now everything is fine.

Bund answered 23/12, 2013 at 20:34 Comment(0)
T
1

Debug version of the vc++ library dlls are NOT meant to be redistributed!

Debug versions of an application are not redistributable, and debug versions of the Visual C++ library DLLs are not redistributable. You may deploy debug versions of applications and Visual C++ DLLs only to your other computers, for the sole purpose of debugging and testing the applications on a computer that does not have Visual Studio installed. For more information, see Redistributing Visual C++ Files.

I will provide the link as well : http://msdn.microsoft.com/en-us/library/aa985618.aspx

Timeworn answered 10/10, 2014 at 13:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.