C++ executable - MSVCR100.dll not found error

SharpAffair picture SharpAffair · Aug 8, 2011 · Viewed 13k times · Source

I've downloaded and compiled an open-source C++ application, Frhed.

When I run the version I've compiled, it demands MSVCR100 and few other dll files (part of Visual C++ redistributable). However, when I run the original precompiled Frhed executable, it runs without any C++ redistributable package installed.

Do I have to modify any compilation options in order to unlink the program from the C++ redistributable libraries?

Answer

foxy picture foxy · Aug 8, 2011

The original program is probably statically linked, whereas you are trying to dynamically link your executable, which results in a smaller file, but a dependency on functions inside MSVCR100.dll (v10 of the Microsoft C Runtime Library), which would have been included inside the executable if you were statically linking.

To statically link DLLs, go into your project properties and change the build mode from MD to MT. In Visual Studio 2010/2012, that project property is C/C++ -> Code Generation -> Runtime Library.