Avoiding the MSVCR110.dll or MSVCR110D.dll is missing error

MSVCR110.dll

This MSVCR110.dll is the Microsoft Visual C++ Redistributable dll that is needed for projects built with Visual Studio 2011. The dll letters spell this out.

MS = Microsoft
V = Visual
C = C++
R = Redistributable

If you create a C++ project in Visual Studio 2011, this file is probably needed.

MSVCR110D.dll

The MSVCR110D.dll is almost the same file only the D at the end stands for Debug. This file has debugging enabled.

Why the error?

Ok, so recently I switched to Visual Studio 2011.  I had a C++ application that worked perfectly in Visual Studio 2008.  Once I compiled it with Visual Studio 2011 and ran it on a clean 2008 server (fully patched but otherwise clean), it failed to run with the following error.

TestWin32.exe – System Error

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

Here is the screen shot:

MSVCR110.dll

The same things happens with the debug version of the file, only it is a the debug version of the same DLL as noted by the fact that the DLL name ends with D.

Autorun – System Error

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

The screen shot is identical except for the D in the dll name.

MSVCR110d.dll

I create a new project in Visual Studio 2011 using the project type of C++ Win32 Project and without making a single change to the default project, I built the file and tested it on my clean machine and the same issue occurred.

So obviously that is not acceptable.  It seems like this should just not happen by default, but unfortunately it does.

Solution

It was actually really easy to resolve for my one project.

Here is what I did.

You can solve this any of the following ways:

  1. Statically link to the dll files so they are compiled into my executable instead of referenced as separate dll files.
  2. Included the dll in the same directory as the exe (I actually didn’t try this but I assume it would work).
  3. Forced everyone to install the VC++ Runtime Redistributable before running the app.

The first option seems the most stable and robust and easiest for a single executable. So that is the one I am going to use.

The second option doesn’t really make sense to me and I would probably never do it.  Maybe if I had dozens of executable files that all required the same DLL and I didn’t have an installer, and I wanted to conserve size, which probably wouldn’t happen for me since I am pretty good at creating a quick installer. Though you might be in this a situation.

The third option would make sense if I was planning on running my executable after an install.  During the install I could include the VC++ Runtime Redistributable and all would be fine.

Statically Linking the DLLs

Make sure you resolve it for both Release and Debug.  The steps are slightly different.

Release

  1. In Visual Studio, I went to the project Properties.
  2. I changed my Configuration to Release.
  3. I went under Configuration Properties | C/C++ | Code Generation
  4. Look at the Runtime Library setting.  It is set to this: Multi-threaded DLL (/MD)
    Change it to this: Multi-threaded (/MT)
  5. Rebuild.

Debug

Almost exactly the same as release.

  1. In Visual Studio, I went to the project Properties.
  2. I changed my Configuration to Debug.
  3. I went under Configuration Properties | C/C++ | Code Generation
  4. Look at the Runtime Library setting.  It is set to this: Multi-threaded Debug DLL (/MDd)
    Change it to this: Multi-threaded Debug (/MTd)
  5. Rebuild the debug

It might be a good idea for me to figure out how to change the project so when I create a new project of this type, those settings are the default.

14 Comments

  1. Asit says:

    Thank you so so so much! I have no words to thank you enough :) Saved my life with this info!

  2. Ahmed says:

    It doesn't work with sfml 2.0
    Could you tell me how can i make it ?

  3. Edel says:

    Simple and very helpful. Thank you for sharing.

  4. leandro koiti says:

    thanks a lot! I was starting to think I had to force the user to install something else before running my application

  5. moe says:

    Thanks alot, at last the error is no more ...this was a huge issue . the application would run on all pc's that have visual studio but not on other ones.

  6. anonymous says:

    Excellent. Thank you very much !

  7. Jacek says:

    It doesn't working with SFML 2.0 :(

  8. Dan says:

    Wow! That helped a LOT! Thank you very much for posting!

  9. wangyeqi says:

    thanks, it's helpful

  10. Tạ Quốc Việt says:

    Oh! You helped me a lot! Thanks!

Leave a Reply

Powered by sweetCaptcha