8

i get the following error when i try to run an exe on a x64 machine that was build for x86 CPU using the MC++ compiler (vs2010) on a x86 machine:

The program can’t start because MSVCR100.dll is missing from your computer.

i already have visual studio 2012 (along with Visual C++ 2012 Update 4 redistributable- both x86 and x64) installed on this second (x64) machine.

A quick search tells me the "MSVCR100.dll" is already present in "C:\Windows\System32".

i tried to install the Microsoft Visual C++ 2010 Redistributable but it exited with an error telling me that a superior version is already installed.

Please guide me what i am doing wrong. :)

Alexander
  • 1,152
  • 1
  • 16
  • 18
  • If you built it with VS2010, you must install the VS2010 version of the runtimes. – Roger Rowland Jan 22 '14 at 13:11
  • 2
    To help you with debugging your problem, you might want to try out http://www.dependencywalker.com/ to actually see what exactly your binary is looking for. – Mateusz Kołodziejski Jan 22 '14 at 13:12
  • @RogerRowland but as mentioned: "i tried to install the Microsoft Visual C++ 2010 Redistributable but it exited with an error telling me that a superior version (Microsoft C++ Redistributable 2012 Update 4) is already installed on the system." – Bhavneet Singh Bajwa Jan 22 '14 at 13:13
  • Well, this doesn't happen for me. I can install vcredist for VS2005, VS2008, VS2010 and VS2012 - they are all necessary in our installer for different components. Where did you download the redistributable from? It sounds like you're installing a different VS2012 version rather than the VS2010 version. The installed dlls have different names. Try [downloading from here](http://www.microsoft.com/en-gb/download/details.aspx?id=8328). – Roger Rowland Jan 22 '14 at 13:15
  • @RogerRowland Downloaded (both x86 and x64) from here: http://www.microsoft.com/en-us/download/details.aspx?id=30679 – Bhavneet Singh Bajwa Jan 22 '14 at 13:17
  • That's a VS2012 installer - see the link in my comment above. – Roger Rowland Jan 22 '14 at 13:18
  • @MateuszKołodziejski The program that i try to run is only a single executable, never-the-less, i'll give it a try.. – Bhavneet Singh Bajwa Jan 22 '14 at 13:18
  • @RogerRowland downloaded and installed the package from the link that you provided. Now it gives me another error message telling me "msvcr100d.dll" is missing. i mananged to find the .dll from the internet and copied it to the application folder and the exe worked. But this seems to be a dirty fix, how can i properly install this file? – Bhavneet Singh Bajwa Jan 22 '14 at 13:34
  • `msvcr100d.dll` is a Debug dll - you must not redistribute this. Make sure you are deploying a Release build, not a Debug build. – Roger Rowland Jan 22 '14 at 13:42
  • @RogerRowland Unfortunately i need to deploy the debug build because the exe is a tool for internal usage and it's nature requires it to be "Debugable". – Bhavneet Singh Bajwa Jan 22 '14 at 14:05
  • Note that it contravenes MS license to redistribute Debug dlls onto systems that do not have VS201 installed. – Roger Rowland Jan 22 '14 at 14:58
  • is it in your PATH? – nothingisnecessary Apr 26 '17 at 21:08

2 Answers2

5

Firstly, in 64-bit versions of Windows, 32-bit system executables and application extension files (aka DLLs) are placed in %systemroot%\SysWOW64 instead of %systemroot%\System32 (which, somewhat counterintuitively, contains 64-bit versions in a 64-bit Windows). So the SysWOW64 folder has to be checked for the x86/32-bit MSVC(++) DLLs.

Secondly, though installation of the corresponding visual studio version on the target machine or having accompanied the distributed program with the required C(++) DLLs should, theoretically, solve the problem, it's not necessary. It's sufficient to have the corresponding MSVC++ redistributable package installed (i.e. e.g. Microsoft Visual C++ 2010 x86 redistributable package in this particular case).

Notes:

  1. The aforementioned info are theoretically correct but damaged Windows installations or ... may not conform.
  2. Including the C++ DLLs with the distributed program is acceptable (and possibly a conservative but correct decision) but installing a Visual Studio version solely to be able to use the DLLs in question definitely isn't.
  3. As a side note, C++ redistributable packages don't install the debug versions of the DLLs so installation of or access to a corresponding Visual Studio version is necessary for running debug-compiled applications.
3

Your application needs the dll for VS2010. you should place MSVCR100.dll and MSVCP100.dll from your x86 machine beside your exe. You can also install VS2010 alongside your current VS2012. then you should also install the Service Pack1 for VS2010 to work properly. After installing VS2010 you have access to both mentioned dlls and also you probably don't need to copy them to your exe directory.

Nejat
  • 31,784
  • 12
  • 106
  • 138
  • 1
    i was also thinking to try out the same. i'll give it a try and let you know. – Bhavneet Singh Bajwa Jan 22 '14 at 14:07
  • This worked. Thank You. But this is a shortcoming. Would we be required to install visual studio 2010 on every machine if we want a debuggable exe to execute? – Bhavneet Singh Bajwa Jan 22 '14 at 14:19
  • 2
    you should port the release version of your application in other platforms which do not have VS installed. Debug versions of applications and the various Visual C++ DLLs are not redistributable.For your Debug version to run, you'll need to install the C++ redistributable package in the target PC. – Nejat Jan 22 '14 at 14:31
  • I am getting `MSVCR100.dll` missing error despite the fact I've reinstalled VC++ 2010 redist and have the mentioned DLL in the proper Windows folder. I've copypasted this file into my game folder, but keep receiving the same error... Any ideas? – Alexander Mar 08 '23 at 14:53