Missing msvcr100.dll - visual-studio-2010

I made a program in Visual Studio 2010 on Windows 7 64-bit.
When I try to run it on Windows XP 32-bit I got message that msvcr100.dll is missing. When I try to copy that file from Win7 to WInXP I got message that msvcr100.dll is wrong.
How to set building in VS so msvcr100.dll would not be necessary?

First you need to make sure you're building a 32 bit executable - 64 bit ones won't run on 32 bit Windows.
Then you can either...
Ship the 32 bit redistributables with your application.
Remove the runtime dependency altogether and link statically to the C++ runtimes. To do this, set Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library to Multi-threaded (/MT).

Linking the runtime libraries statically should help. Go to Project Options -> C/C++ -> Code Generation -> Runtime Library and change the value to Multithreaded or Multithreaded Debug and recompile. This way your application shouldn't depend on the runtime DLLs.
Also don't forget to build a 32bit executable.

The answers above helped me along, but I was still getting the error:
fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
So to help other who may have, like me, spent way too much time stumbling around in search of a clear solution, I'd like to add the bit of information that solved this issue for me. As it turns out, my project had the wrong "Use of MFC" setting to make use of the answer above.
To put it in clear terms:
Open up the project properties (alt-F7 or Project-menu -> [My Project] Properties) and go to Project -> Properties -> Configuration Properties
If General -> Use of MFC is set to Use MFC in a Static Library
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded Debug (/MTd) or Multi-threaded (/MT)
and if
General -> Use of MFC is set to Use MFC in a Shared DLL
you must set
C/C++ -> Code Generation -> Runtime Library
to either Multi-threaded DLL (/MD) or Multi-threaded Debug DLL
I got this answer from the Microsoft community answers website and all credit should go to David Wilkinson.

The keyword here is "redistributable" since this error message may occur when attempting to run a .exe that was not developed on the end-user's PC.
The following is a good (and trusted) source to download redistributables without having to download the entire VC++ package or patch:
https://visualstudio.microsoft.com/vs/older-downloads/#microsoft-build-tools-2015-update-3
In my case I needed the "Visual Studio 2010 VC++ Redistributable" even though we are in year 2022.

enter image description here
Step 1.: Go to this website dll-files.com.
enter image description here
dll-files.com is a great repository of Windows DLL files and has almost all the DLL files that are existent on Windows.
Step 2. Now type there your DLL error in the search window of the website.
Step 3. DLL-Files.com will immediately list out the zip file containing that particular DLL file. Download this zip file to your computer and extract it. The extracted folder will contain the DLL error file.
enter image description here
Step 4. Copy the download DLL file (Only that file) and paste this file in your default system folder based on your operating systems below.
C:WindowsSystem (Windows 95/98/Me)
C:WINNT\System32 (Windows NT/2000)
C:\Windows\System32 (Windows XP, Vista, Windows 7/Windows 8.1/Windows 10)
Windows will ask you whether you want to replace the existing DLL file with the new one. Say yes and let Windows copy the file. Restart your computer and voila, you can now run the game/app that was not opening and giving the DLL error, easily.
There are many other websites which will give you DLL files that you want

Related

Cannot find or open PDB File error when running the program even though it builds successfully

I have a project in visual c++ where I am referring some external DLL.
I have already included the lib directory in linker section and mention it in the input section of the linker and also included the same in c/c++ General Additional Include Directories section.
Thus the project compiles successfully but whenever I try to run it; it fails with an error "Application was unable to start correctly" but if I see the output section it seems everything is loaded correctly but against that particular Dll it says that "Cannot find or open the PDB file".
How to fix this error so that I can run my program. It is an MFC program running in Visual Studio 2010.
when I run the program through the Dependency Walker, most of the API-MS-WIN-CORE-HEAP, FILE, and EXT-MS-WIN-SESSION USERMGR -l1-1-0.dll many similar to this are unavailable. I even tried to repair the visual studio it didn't work. Is there any idea how to go about it
0x0000007b sounds familiar to me.
Most likely that is due to 32/64 bit library mixture you are linking with.
Either you are building for x64 and linking with a win32 external library or vice versa.
In your Visual Studio project settings separately configure platform architectures you are compiling for and then you can choose the profile which you are actually compiling for.

Visual Studio 2010 Runtime Libraries

I wrote a tool that many users would use on their computers. I noticed however, that users who do not have visual studio installed, cannot open my executable. The error says that msvcp100.dll is missing. I found in internet a redistributable package from microsoft, that should apparently provide these dlls. My question is: is there another way to bypass this problem? Something like an option in the project properties?
Yes, you can change a compiler setting to link the C++ standard library classes into your program instead of having a dependency on the DLL. Right-click your project in the Solution Explorer window, Properties. Switch to the Release configuration (upper left). C/C++, Code Generation, Runtime Library setting. Select /MT.
Only do this when you only have a single monolithic EXE. When you use your own DLLs then you really need msvcr100.dll and msvcp100.dll so that the runtime library gets shared between all modules.
It is part of C++ runtime and the target machine needs it. THere are couple of ways to address it.
Please check following link from Microsoft MCVCP100.DLL

Compiling C++/CLI .exe

I wrote a C++/CLR Windows Form program and it works fine on the compiler computer but not on any others. The target computers have .Net4 and the C++ redistribution pack. I really don't understand how the settings need to be set and the info on the web concerning this stuff is very confusing for a beginner. How do I need to have my compiler set so that I can get this program to run? If I need to link .dll's how do I go about doing that. Here are the key settings as I know:
The Runtime Library is set to /MDd; MFC:Standard Windows Libaries; ATL:Static Link to ATL; CLR:/clr:pure.
Edit: If I install VS on taget computers I can open the .exe without a problem, not even opening VS or loading any source files. It seems it's still dependent on VS somehow, any idea's on this and how to over come it?
/MDd specifies a dynamic debug CRT, this won't be installed by the standard CRT redistributable MSI
Try putting a release build on the target machine instead.

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.
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.
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.
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
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
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.
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

OpenGL config in Visual Studio 2010

i would like to use OpenGl in Visual Studio 2010. Following Problem: "error LNK1104: Data "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" could not be oppend"
I read many Tutorials but they don´t help me :-(.
The lib data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\lib".
The header data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\Include\gl"
The dll data sets are in "C:\Windows\SysWOW64"
I Use Windows 7 Professional 64Bit.
I put "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" on Project > Properties > Linker > Input.
This is what you need to do.
Obtain GLUT for Windows (OpenGL Utility Toolkit) from Nate Robins’ web page. I put it on my C drive. The current documentation for GLUT tells you to go into the glut project folder and build the glut.dsw Visual Studio project. This is a little misleading since there is no glut.dsw file and all the dll, lib etc files you need are already there! So don’t worry about doing this, just download it.
Create a Visual Studio Project such as a new Console Application. For Windows XP: paste the glut32.dll file into: C:\Windows\System32. For Windows 7: place the glut32.dll inside the C:\Windows\SysWOW64 folder instead.
In the Project properties, select C/C++ -> General -> Additional Include Directories and add the location of the glut.h header file. This might be C:\glut-3.7.6-bin\
In the Project properties, select Linker -> General -> Additional Library Directories and add the location of the glut libraries eg C:\glut-3.7.6-bin\
In the Project properties, select Linker -> Input -> Additional Dependencies and add “glut32.lib”.
It should then compile. For a more detailed explanation, plus advice for installing the latest Windows Drivers from the Intel site, see this blog post.
Your error message lists all missing files in the same error.
That means you didn't set your dependencies correctly, because the linker searched for the file "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib", which doesn't exist, of course.
The file names have to be separated by ";" in the Additional Dependencies section (under Linker > Input).
Or, if you use the edit menu by choosing it from the drop-down selection, each dependency has to be in a new line.
So you have to write "GIU32.lib;OpenGL32.lib;freeglut.lib;glut32.lib".
If error persists, you just put the libs in wrong place. Try to define additional lib path in project properties (sorry, I don't have VS 2010 around to show you exact location).
The DLLs need to be in BOTH system32 and syswow64
See here:
http://www.james-bennet.com/2011/10/using-glut-under-visual-studio-2010/
Has a HOWTO including a screenshot of the linker options you need to set.

Resources