1

I was reading in MSDN ( here ) about the different CRT libraries in Windows.

According to it, msvcrt.lib is a:

Static library for the native CRT startup for use with DLL UCRT and vcruntime.

while ucrt.lib is a:

DLL import library for the UCRT.

This is why ucrt.lib have an associated vcrtbase.dll dll, but for my understanding of the reference there is no associated dll for msvcrt. Yet, I can see there is a msvcrt.dll out there, and that its loaded into applications.

So my question is simple, why a static library needs a dll? maybe its because msvcrt.dll is actually the same as msvcrt.lib but in a dynamic form? If so, why ucrtbase.dll is needed? (maybe performance over the outdated msvcrt?)

Thanks for any insight that dissolve this mist.

Z E Nir
  • 332
  • 1
  • 2
  • 15
  • You may want to specify a Visual Studio version, as these things have changed over time. Also, Visual Studio has long had a `/MT` and `/MD` switch to choose between LIB and DLL versions of the CRT. The existence of a `msvcrt.dll` does not imply that it's the only possibility. – MSalters May 04 '20 at 08:50
  • 1
    It has a rather unfortunate name, affected by history. msvcrt.dll dates from the 1990s and is still around as the dynamic runtime library that Windows executables are linked with. You can't take a dependency on it, no .lib to link with. msvcrt.lib today is a static library, just links in the essential startup code that a DLL needs to keep motoring with the dynamic runtime libraries. – Hans Passant May 04 '20 at 09:36

0 Answers0