0

I noticed these pieces of content:

In Microsoft's documentation, it says that MSVC Redistributable is a runtime library, and it also says that crt contains functions and global variables exported from the standard C99 CRT library (This is not part of the runtime library definition, is it?).

But I found very many articles that say MSVC Redistributable is a set of dynamic library files.

May I ask what exactly is MSVC Redistributable?

tadman
  • 208,517
  • 23
  • 234
  • 262
  • Sometimes both static and dynamic options are made available. "Runtime library" is just a generic term for important language libraries, much like libc, etc. It is not mutually exclusive with dynamic library. – tadman Jul 12 '23 at 15:37
  • 2
    There's no need to redistribute static libraries since the linker makes them part of your executable. But the C runtime is made available as a static or dynamic library and the developer can choose which to use. If they choose dynamic then they will need to distribute those dynamic libraries along with their application. – john Jul 12 '23 at 15:41
  • 2
    The MSVC redist package installs the release DLLs need to support programs compiled with the [`/MD`](https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-170) compiler option (as apposed to the `/MT` option). _"...Causes the application to use the multithread-specific and DLL-specific version of the run-time library...."_ – Richard Critten Jul 12 '23 at 15:41

1 Answers1

1

The MSVC Redistributables are particular implementations of the C (and to a lesser extent C++*) standard libraries, as well as similar builds of some important VC components (MFC/ATL). They provide concrete implementations of the library functionality dictated by the language standards, along with some MS-specific functionality. Microsoft makes these libraries available in a form that you can legally include with binaries you have built, that is why they are called "redistrubatable". And note that only the release builds of the dynamic libraries are covered, you cannot legally include either the debug form of the dynamic libraries or the static libraries at all.

  • I say lesser extent for C++ because very much of the C++ standard library is in the form of templates that are evaluated at build-time by the compiler, rather than anything that can be shipped compiled in a standard form.
SoronelHaetir
  • 14,104
  • 1
  • 12
  • 23