Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is not the new Visual Studio runtime part of Windows

I know that I have to distribute C / C++ runtime libraries along with my project. I am just wondering why Microsoft does not do that for us? I know that there is Visual Studio 6.0 runtime included in Windows but why there is no new one?

If somebody could give me a link to some explanation article. I am trying to google that without success for a while.

like image 970
jhruby Avatar asked Dec 18 '13 07:12

jhruby


1 Answers

There is a C runtime included with Windows, msvcrt.dll. The MinGW gcc variation uses that library as its base runtime. Microsoft also builds programs that link to that runtime (for example, the programs that are part of the Windows installation).

While the msvcrt.dll that is part of Windows has the same name as the runtime DLL from VC6, it's not necessarily the VC6 runtime. Each new version of Windows has added functions to the msvcrt.dll and probably fixed some bugs.

The WDK used to include build configurations to link to msvcrt.dll (it looks like the last version of the WDK to support this was WDK 7.1). These build configurations also included some compatibility shims, such as msvcrt_win2003.obj, that allow a program built with such a configuration to run against the msvcrt.dll libraries included with older versions of Windows - adding support for newer exception handling and some newer APIs, for example.

I suspect there are various reasons that MS prefers that 3rd party programs link to runtimes that are not part of the Windows system files. A couple possible reasons:

  • it helps ensure that the 3rd party programs are not broken by a Windows update that includes a newer version of msvcrt.dll.
  • it helps ensure that 3rd party programs will run against the runtime DLLs that they were tested against (since presumably the 3rd party program's installer also makes certain that the appropriate MSVC redistributable runtime is installed).
like image 164
Michael Burr Avatar answered Oct 12 '22 12:10

Michael Burr