How to make your C++ app independent of Visual C++ Runtime?
If you are developing the Visual C++ apps, then probably you have stumbled upon the problem that appears once you try to transfer the app ato another computer. The app shows MSVCR100.DLL (or MSVCR71.DLL) not found error.
The app is fully wonrking on your computer, so thats quite confusing. Official Microsoft documentation suggests that you install special Visual C++ redistributable component. But there are lots of versions of this component: different architecture (x86 or x64), different Visual Studio versions. etc. Sometimes these components are conflicting with each other. One version is working with one program, but needs to be reinstalled to work with another program... Quite a mess!
Fortunately enough, there is a way to fix the MSVCR100.DLL missing error without the need to install runtime. But how is it possible?
The answer is you can built the needed runtime inside your application! Your application will add in size, approximately 3 Megabytes, but who cares about it today, when we transfer gigabytes of information over the Internet each day?
So, in order to make your app runtime independent, open your project properties: Right click on the VC++ Project ->Properties.
On the property page, select C\C++ -> Code Generation. For the Runtime Library select Mutlithreaded Debug (for Debug configuration) or Mutlithreaded Release (for release).
After recompiling the project, you will find out that your app no longer needs MSVCR100.DLL and can be run on any other computer.