Latest posts by Alex Margolin (see all)
TL;DR Even old windows versions (2000+) have the basic runtime environment available in msvcrt.dll, while recent Visual Studio links against a newer msvcrXX.dll (from 50 to 130), which require additional installation from the user. To build an executable to work “out-of-the-box” – set Visual Studio to use msvcrt.lib, and run some commands described below.
Since the dawn of time, writing in C would imply using a run-time environment, providing functions as simple as strlen(), among other things. With time, new API was added, Microsoft produced newer versions of the run-time environment. Visual C++ (AKA Visaul Studio) versions 4.2 to 6.0 links against msvcrt.dll, which is shipped with Windows 2000 and onward. Other versions link against different versions of the run-time environment named msvcrXX.dll, which can be as old as msvcr20.dll or as new as msvcr130.dll on VS2013 (which is the latest version of VS as of the date these lines being written), and onward (140, 150…) as new versions of VS will be published and this post becomes an integral part of history ). Here’s the catch: Windows versions are not shipped with these newer run-time environments. Continue reading “Building executables for old versions of windows without redistribute packages (or: Ode to msvcrt.lib & msvcrt.dll duo)”