- Наш адрес -
- г. Москва -
- Пн,Вт, Ср, Чт, Пт9:00—18:00
Microsoft C Runtime (CRT) is a collection of libraries that provide the essential infrastructure for C and C++ programs to run on the Windows operating system. It acts as the bridge between your code and the underlying OS, handling everything from basic input/output to memory management and program startup. Microsoft Learn What is in the CRT?
The CRT is more than just a list of functions; it consists of two primary components: The C Standard Library
: This includes implementations of standard ISO C functions you likely recognize, such as Compiler-Specific Functions : These are internal "auxiliary" functions that the Visual C++ compiler
uses to handle things the C language doesn't define natively, like structured exception handling, process startup, and floating-point math support. Microsoft Learn Evolution: From MSVCRT to Universal CRT (UCRT) For years, every major version of Visual Studio came with its own standalone CRT (e.g., msvcr100.dll
for VS 2010). This often led to "DLL Hell," where a user might have dozens of different versions installed.
Starting with Visual Studio 2015, Microsoft refactored the CRT into the Universal CRT (UCRT) Microsoft Dev Blogs A Windows Component
: The UCRT is now a part of the Windows OS itself (Windows 10 and later). Stable Identity
: Instead of a new DLL for every compiler version, the UCRT remains stable, and only the Visual C++ Redistributables (which contain the C++ specific parts) are updated. Microsoft Learn Why do I see so many "Redistributables" installed?
You may notice multiple versions of the "Microsoft Visual C++ Redistributable" in your Control Panel. This is because: Version Specificity
: When a developer builds an app, they target a specific version of the CRT. If you uninstall that specific version, any app depending on it will crash or fail to launch. Safety First : It is generally recommended to leave them alone
. They take up very little space, and removing them can break essential software like games or creative tools. Common Troubleshooting If you encounter a "Runtime Error" or a message saying a is missing: Install Latest Redistributables : Visit the Microsoft official download page to install the latest x86 and x64 packages. Check Windows Update
: Since the UCRT is a system component, ensuring Windows is up-to-date can resolve many base runtime issues. Microsoft Learn Why Are There So Many Copies of the Visual C++ Runtime? 19 Aug 2024 —
The Microsoft C Runtime (CRT) is a set of libraries and routines that provide the essential foundation for programs written in C and C++ to run on the Windows operating system . It handles everything from memory allocation and string manipulation to more complex tasks like exception handling and startup code . 1. Key Components of the Modern CRT
Starting with Visual Studio 2015, Microsoft refactored the CRT into several distinct parts to improve compatibility across Windows versions .
Universal C Runtime (UCRT): A stable, Windows-integrated component that contains standard C library functions (like printf, malloc, and math routines) . It conforms closely to the ISO C99 standard .
VCRUNTIME: Contains code specific to the Microsoft Visual C++ compiler, such as exception handling, debugging support, and runtime checks . This library must match the version of the compiler used to build the app .
MSVCP: This corresponds to the C++ Standard Library (STL) . It contains routines for C++ specific features like input/output streams and data structures . 2. Versions and Naming Conventions microsoft c runtime
Older versions used a single monolithic DLL (like msvcrt.dll or msvcr120.dll), while newer ones use versioned filenames : Version Range Description Legacy (Pre-VS 2015) msvcrt.dll, msvcrXX.dll
Monolithic libraries tied to specific Visual Studio versions . Modern (VS 2015+) ucrtbase.dll, vcruntime140.dll Refactored into Universal and compiler-specific parts . C++ Standard msvcp140.dll Specifically for C++ Standard Library features . 3. Deployment and the "Redistributable"
When you develop an app, users need these libraries to run it. There are two main ways to provide them: C runtime (CRT) and C++ standard library (STL) lib files
Introduction
The Microsoft C Runtime, also known as the Microsoft C Runtime Library or MSVCRT, is a software library that provides a set of functions and APIs for C and C++ programs to interact with the Windows operating system. It is a crucial component of the Microsoft Visual C++ (MSVC) compiler suite and is used by millions of applications worldwide.
History
The Microsoft C Runtime has its roots in the early days of Microsoft's involvement in the C programming language. In 1982, Microsoft released its first C compiler, which was based on the UNIX-based C compiler developed by Brian Kernighan and Dennis Ritchie. Over the years, Microsoft has continued to evolve and improve the C Runtime, adding new features, and adapting it to the changing needs of Windows developers.
Components
The Microsoft C Runtime consists of several key components:
printf(), scanf())strcpy(), strcmp())malloc(), free())exit(), abort())std::vector, std::list)std::sort, std::find)CreateFile(), ReadFile())CreateProcess(), TerminateProcess())Architecture
The Microsoft C Runtime is designed as a layered architecture, with the following components:
Features
The Microsoft C Runtime provides a wide range of features, including:
malloc(), free(), and realloc().printf(), scanf(), and fopen().Deployment
The Microsoft C Runtime is typically deployed as a DLL (Dynamic Link Library) file, which is loaded into memory when a program that depends on it is executed. The C Runtime DLL is usually included with Microsoft Visual C++ installations and can be redistributed with applications.
Versions
Over the years, Microsoft has released several versions of the C Runtime, including:
Conclusion
The Microsoft C Runtime is an essential component of the Microsoft Visual C++ compiler suite and provides a wide range of functions and APIs for C and C++ programs to interact with the Windows operating system. Its layered architecture, thread-safety features, and support for exception handling make it a robust and reliable runtime environment for building Windows applications.
What is the Microsoft C Runtime?
The Microsoft C Runtime is a collection of libraries, functions, and APIs that provide a runtime environment for C and C++ programs compiled with the MSVC compiler. The CRT is responsible for managing memory, handling exceptions, and providing various utility functions for tasks such as input/output operations, string manipulation, and mathematical calculations.
Key Components of the Microsoft C Runtime
malloc, free), input/output operations (e.g., printf, scanf), and string manipulation (e.g., strcpy, strlen).sin, cos), exponential functions (e.g., exp, log), and statistical functions (e.g., sqrt, pow).Features of the Microsoft C Runtime
malloc, calloc, realloc, and free.try, catch, and throw.printf, scanf, getchar, and putchar.Importance of the Microsoft C Runtime
The Microsoft C Runtime is essential for running C and C++ programs on Windows operating systems. Without the CRT, programs compiled with the MSVC compiler would not be able to execute properly. The CRT provides a layer of abstraction between the program and the operating system, allowing developers to focus on writing application code rather than worrying about low-level details.
Common Issues with the Microsoft C Runtime
In conclusion, the Microsoft C Runtime is a critical component of the MSVC compiler, providing a set of libraries and functions that enable C and C++ programs to run on Windows operating systems. Understanding the features, components, and importance of the CRT is essential for developing reliable and efficient applications.
The Microsoft C Runtime (CRT) is a library of functions that provides the essential underlying support for the C and C++ programming languages in Windows applications. It handles critical low-level tasks such as memory management, process startup, and input/output. Core Components
Universal C Runtime (UCRT): A core Windows OS component since Windows 10 that provides the standard C library functions.
vcruntime: Contains compiler-specific support routines, such as exception handling and check routines.
Standard C++ Library (msvcprt): Built on top of the CRT to provide C++ specific features like STL containers (e.g., std::vector). Installation and Deployment
For an application to run, the target machine must have the corresponding CRT files installed. This is typically achieved through: Latest Supported Visual C++ Redistributable Downloads Microsoft C Runtime (CRT) is a collection of
A Visual C++ Redistributable installs Microsoft C and C++ Runtime libraries. Many applications built by using Microsoft Visual C++ Microsoft Learn C runtime (CRT) and C++ standard library (STL) lib files
Microsoft C Runtime (CRT) is a critical collection of libraries and routines that support program development in the C and C++ languages. It provides the low-level building blocks—such as memory management, file handling, and math functions—that applications need to run on the Windows operating system. Core Components
The CRT has evolved from multiple version-specific libraries into a more unified structure: Universal C Runtime (UCRT):
Since Visual Studio 2015, the UCRT has become a core component of Windows 10 and 11. It provides the standard C library functions (like
) that are now shared across different versions of the compiler. vcruntime:
This contains compiler-specific support routines, such as exception handling and check-summing, which vary between different versions of Visual Studio. Standard Library (STL):
While separate from the CRT, the C++ Standard Library depends heavily on the CRT for its underlying operations. Microsoft Learn Deployment & Installation
To run an application built with Visual C++, the target computer must have the corresponding runtime files. Universal CRT deployment - Microsoft Learn
The CRT is not one monolithic block – it consists of several logical parts:
| Component | Description |
|-----------|-------------|
| Startup code | mainCRTStartup, WinMainCRTStartup – sets up the environment, calls constructors, then invokes main/WinMain |
| Standard C functions | <stdio.h>, <stdlib.h>, <string.h>, <math.h>, <time.h>, etc. |
| C++ standard library | <iostream>, <vector>, <string>, <algorithm>, <locale> (largely implemented in headers + static helper code) |
| Heap management | malloc, free, new, delete, _heap_* functions |
| Locale & multibyte/Unicode | setlocale, wchar_t functions, code pages |
| Exception handling | Support for C++ try/catch, structured exception handling (SEH) |
| Floating-point support | Initialization of FPU, math error handling |
| Low-level I/O | _open, _read, _write (OS call wrappers) |
| Security enhancements | _s functions with bounds checking |
Today, the Microsoft C Runtime is a patchwork of history and innovation. It carries legacy behaviors that ensure decades-old applications still run, while adopting modern improvements that make new applications safer and faster. The ecosystem around it—toolchains, redistributables, and compatibility layers—reflects a larger truth about software: ecosystems matter as much as code.
Looking forward, native development models continue to evolve. Web and managed runtimes grow, but system-level, high-performance native code remains essential in many domains. The CRT’s role may shift towards smaller, more secure cores, or toward modular, auditable components that better fit modern supply-chain and security needs. Regardless, the Microsoft C Runtime’s history shows how an unglamorous library can shape an entire platform’s reliability, security, and developer productivity.
If you are distributing a Windows application, which DLLs must you include? Here is the breakdown for a modern (Visual Studio 2015–2022) C++ application using dynamic linking.
Core Universal CRT (Part of Windows):
ucrtbase.dll – The Universal CRT. Core functions.api-ms-win-crt-*.dll – A set of "API Set" forwarder DLLs that the UCRT uses to call into the Windows kernel.The VCRuntime (Visual Studio Specific):
vcruntime140.dll – For 32-bit (x86) applications.vcruntime140d.dll – Debug version (do not distribute).vcruntime140_1.dll – For C++ exception handling improvements in newer toolsets.The MFC/ATL (If you use Microsoft Foundation Classes): C Standard Library : This component provides an
mfc140u.dll – MFC Unicode release.atl140.dll – Active Template Library.The OpenMP Runtime (If you use parallel loops):
vcomp140.dllDeployment Check for Developers:
Run dumpbin /dependents myapp.exe. This will list every DLL your program expects. If you see vcruntime140.dll and ucrtbase.dll, you must ensure the Visual C++ Redistributable is installed on the target PC.