You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Microsoft runtime library provides routines for programming for the Microsoft Windows operating system. These routines automate many common programming tasks that are not provided by the C and C++ languages.
12
11
13
12
Sample programs are included in the individual reference topics for most routines in the library.
14
13
15
14
## In This Section
16
15
17
-
[C Runtime libraries](crt-library-features.md)\
18
-
Discusses the .lib files that comprise the C runtime libraries.
19
-
20
16
[Universal C runtime routines by category](run-time-routines-by-category.md)\
21
17
Provides links to the runtime library by category.
22
18
@@ -41,6 +37,9 @@ Provides links to the C runtime library functions, organized by function family.
41
37
[Language and country/region strings](locale-names-languages-and-country-region-strings.md)\
42
38
Describes how to use the `setlocale` function to set the language and Country/Region strings.
43
39
40
+
[[C Runtime (CRT) and C++ Standard Library .lib files]](crt-library-features.md)\
41
+
Discusses the .lib files that comprise the C runtime libraries and their associated compiler options and preprocessor directives.
Copy file name to clipboardExpand all lines: docs/c-runtime-library/crt-library-features.md
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,21 @@
1
1
---
2
-
title: "CRTLibrary Features"
3
-
description: "List of files that contain the Microsoft C run-time libraries, and their associated compiler options and preprocessor directives."
4
-
ms.date: 09/03/2020
5
-
ms.topic: "conceptual"
2
+
title: "C Runtime (CRT) and C++ Standard Library .lib files"
3
+
description: "List of Microsoft C runtime and C++ Standard Library .lib files that you can link against and their associated compiler options and preprocessor directives."
# C Runtime (CRT) and C++ Standard Library .lib files
10
9
11
-
This topic discusses the various .lib files that comprise the C run-time libraries as well as their associated compiler options and preprocessor directives.
10
+
This topic lists the Microsoft C runtime library .lib files that you can link against when you develop your application, and their associated compiler options and preprocessor directives.
12
11
13
-
## C Run-Time Libraries (CRT)
12
+
See [Redistributing Visual C++ files](../windows/redistributing-visual-cpp-files.md) if you are looking for information about deploying the C runtime files necessary to support your application.
14
13
15
-
The C Run-time Library (CRT) is the part of the C++ Standard Library that incorporates the ISO C99 standard library. The Visual C++ libraries that implement the CRT support native code development, and both mixed native and managed code. All versions of the CRT support multi-threaded development. Most of the libraries support both static linking, to link the library directly into your code, or dynamic linking to let your code use common DLL files.
14
+
See [C runtime library reference](../c-runtime-library/c-run-time-library-reference.md) if you are looking for API reference for the C runtime library.
15
+
16
+
## C runtime .lib files
17
+
18
+
The C runtime Library (CRT) is the part of the C++ Standard Library that incorporates the ISO C99 standard library. The Visual C++ libraries that implement the CRT support native code development, and both mixed native and managed code. All versions of the CRT support multi-threaded development. Most of the libraries support both static linking, to link the library directly into your code, or dynamic linking to let your code use common DLL files.
16
19
17
20
Starting in Visual Studio 2015, the CRT has been refactored into new binaries. The Universal CRT (UCRT) contains the functions and globals exported by the standard C99 CRT library. The UCRT is now a Windows component, and ships as part of Windows 10. The static library, DLL import library, and header files for the UCRT are now found in the Windows 10 SDK. When you install Visual C++, Visual Studio setup installs the subset of the Windows 10 SDK required to use the UCRT. You can use the UCRT on any version of Windows supported by Visual Studio 2015 and later versions. You can redistribute it using vcredist for supported versions of Windows other than Windows 10. For more information, see [Redistributing Visual C++ Files](../windows/redistributing-visual-cpp-files.md).
18
21
@@ -25,7 +28,7 @@ The following table lists the libraries that implement the UCRT.
25
28
|*`ucrt.lib`*|*`ucrtbase.dll`*| DLL import library for the UCRT. |**`/MD`**|`_MT`, `_DLL`|
26
29
|*`ucrtd.lib`*|*`ucrtbased.dll`*| DLL import library for the Debug version of the UCRT. Not redistributable. |**`/MDd`**|`_DEBUG`, `_MT`, `_DLL`|
27
30
28
-
The vcruntime library contains Visual C++ CRT implementation-specific code, such as exception handling and debugging support, runtime checks and type information, implementation details and certain extended library functions. This library is specific to the version of the compiler used.
31
+
The vcruntime library contains Visual C++ CRT implementation-specific code, such as exception handling and debugging support, runtime checks and type information, implementation details and certain extended library functions. The vcruntime library version needs to match the version of the compiler you are using.
29
32
30
33
This table lists the libraries that implement the vcruntime library.
31
34
@@ -37,7 +40,7 @@ This table lists the libraries that implement the vcruntime library.
37
40
|*`vcruntimed.lib`*|*`vcruntime<version>d.dll`*| DLL import library for the Debug vcruntime. Not redistributable. |**`/MDd`**|`_DEBUG`, `_MT`, `_DLL`|
38
41
39
42
> [!NOTE]
40
-
> When the UCRT refactoring occurred, the Concurrency Runtime functions were moved into
43
+
> When the UCRT was refactored, the Concurrency Runtime functions were moved into
41
44
*`concrt140.dll`*, which was added to the C++ redistributable package. This DLL is required for C++ parallel containers and algorithms such as `concurrency::parallel_for`. In addition, the C++ Standard Library requires this DLL on Windows XP to support synchronization primitives, because Windows XP does not have condition variables.
42
45
43
46
The code that initializes the CRT is in one of several libraries, based on whether the CRT library is statically or dynamically linked, or native, managed, or mixed code. This code handles CRT startup, internal per-thread data initialization, and termination. It is specific to the version of the compiler used. This library is always statically linked, even when using a dynamically linked UCRT.
@@ -55,21 +58,21 @@ This table lists the libraries that implement CRT initialization and termination
55
58
|*`msvcurt.lib`*|**Deprecated** Static library for the pure managed CRT. |**`/clr:pure`**||
56
59
|*`msvcurtd.lib`*|**Deprecated** Static library for the Debug version of the pure managed CRT. Not redistributable. |**`/clr:pure`**||
57
60
58
-
If you link your program from the command line without a compiler option that specifies a C run-time library, the linker will use the statically linked CRT libraries: *`libcmt.lib`*, *`libvcruntime.lib`*, and *`libucrt.lib`*.
61
+
If you link your program from the command line without a compiler option that specifies a C runtime library, the linker will use the statically linked CRT libraries: *`libcmt.lib`*, *`libvcruntime.lib`*, and *`libucrt.lib`*.
59
62
60
63
Using the statically linked CRT implies that any state information saved by the C runtime library will be local to that instance of the CRT. For example, if you use [`strtok`](../c-runtime-library/reference/strtok-strtok-l-wcstok-wcstok-l-mbstok-mbstok-l.md) when using a statically linked CRT, the position of the `strtok` parser is unrelated to the `strtok` state used in code in the same process (but in a different DLL or EXE) that is linked to another instance of the static CRT. In contrast, the dynamically linked CRT shares state for all code within a process that is dynamically linked to the CRT. This concern does not apply if you use the new more secure versions of these functions; for example, `strtok_s` does not have this problem.
61
64
62
-
Because a DLL built by linking to a static CRT will have its own CRT state, it is not recommended to link statically to the CRT in a DLL unless the consequences of this are specifically desired and understood. For example, if you call [`_set_se_translator`](../c-runtime-library/reference/set-se-translator.md) in an executable that loads the DLL linked to its own static CRT, any hardware exceptions generated by the code in the DLL will not be caught by the translator, but hardware exceptions generated by code in the main executable will be caught.
65
+
Because a DLL built by linking to a static CRT has its own CRT state, it isn't recommended to link statically to the CRT in a DLL unless the consequences of this are specifically desired and understood. For example, if you call [`_set_se_translator`](../c-runtime-library/reference/set-se-translator.md) in an executable that loads the DLL linked to its own static CRT, any hardware exceptions generated by the code in the DLL will not be caught by the translator, but hardware exceptions generated by code in the main executable will be caught.
63
66
64
67
If you are using the **`/clr`** compiler switch, your code will be linked with a static library, msvcmrt.lib. The static library provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( **`/MT`** or **`/MTd`** options) with **`/clr`**. Use the dynamically-linked libraries (**`/MD`** or **`/MDd`**) instead. The pure managed CRT libraries are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
65
68
66
69
For more information on using the CRT with **`/clr`**, see [Mixed (Native and Managed) Assemblies](../dotnet/mixed-native-and-managed-assemblies.md).
67
70
68
71
To build a debug version of your application, the [`_DEBUG`](../c-runtime-library/debug.md) flag must be defined and the application must be linked with a debug version of one of these libraries. For more information about using the debug versions of the library files, see [CRT Debugging Techniques](/visualstudio/debugger/crt-debugging-techniques).
69
72
70
-
This version of the CRT is not fully conformant with the C99 standard. In versions before Visual Studio 2019 version 16.8, the \<tgmath.h> header is not supported. In all versions, the `CX_LIMITED_RANGE` and `FP_CONTRACT` pragma macros are not supported. Certain elements such as the meaning of parameter specifiers in standard IO functions use legacy interpretations by default. You can use **`/Zc`** compiler conformance options and specify linker options to control some aspects of library conformance.
73
+
This version of the CRT isn't fully conformant with the C99 standard. In versions before Visual Studio 2019 version 16.8, the \<tgmath.h> header isn't supported. In all versions, the `CX_LIMITED_RANGE` and `FP_CONTRACT` pragma macros are not supported. Certain elements such as the meaning of parameter specifiers in standard IO functions use legacy interpretations by default. You can use **`/Zc`** compiler conformance options and specify linker options to control some aspects of library conformance.
71
74
72
-
## C++ Standard Library
75
+
## C++ Standard Library .lib files
73
76
74
77
| C++ Standard Library | Characteristics | Option | Preprocessor directives |
75
78
|--|--|--|--|
@@ -78,7 +81,7 @@ This version of the CRT is not fully conformant with the C99 standard. In versio
78
81
|*`libcpmtd.lib`*| Multithreaded, static link |**`/MTd`**|`_DEBUG`, `_MT`|
79
82
|*`msvcprtd.lib`*| Multithreaded, dynamic link (import library for *`msvcp<version>d.dll`*) |**`/MDd`**|`_DEBUG`, `_MT`, `_DLL`|
80
83
81
-
When you build a release version of your project, one of the basic C run-time libraries (*`libcmt.lib`*, *`msvcmrt.lib`*, *`msvcrt.lib`*) is linked by default, depending on the compiler option you choose (multithreaded, DLL, **`/clr`**). If you include one of the [C++ Standard Library header files](../standard-library/cpp-standard-library-header-files.md) in your code, a C++ Standard Library will be linked in automatically by Visual C++ at compile time. For example:
84
+
When you build a release version of your project, one of the basic C runtime libraries (*`libcmt.lib`*, *`msvcmrt.lib`*, *`msvcrt.lib`*) is linked by default, depending on the compiler option you choose (multithreaded, DLL, **`/clr`**). If you include one of the [C++ Standard Library header files](../standard-library/cpp-standard-library-header-files.md) in your code, a C++ Standard Library will be linked automatically by Visual C++ at compile time. For example:
82
85
83
86
```cpp
84
87
#include<ios>
@@ -98,4 +101,5 @@ Be careful if your program passes certain CRT resources across DLL boundaries. R
Copy file name to clipboardExpand all lines: docs/standard-library/cpp-standard-library-reference.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
2
description: "Learn more about: C++ Standard Library Reference"
3
3
title: "C++ Standard Library Reference"
4
-
ms.date: "11/04/2016"
4
+
ms.date: "3/5/2021"
5
5
helpviewer_keywords: ["C++ Standard Library, reference", "C++ Standard Library", "template libraries", "libraries, Standard C++"]
6
-
ms.assetid: a37d3ba3-58af-47c7-9ee2-441ccd7b77ee
7
6
---
8
-
# C++ Standard Library Reference
9
7
10
-
A C++ program can call on a large number of functions from this conforming implementation of the C++ Standard Library. These functions perform essential services such as input and output and provide efficient implementations of frequently used operations.
8
+
#C++ Standard Library reference
11
9
12
-
For more information about Visual C++ run-time libraries, see [CRT Library Features](../c-runtime-library/crt-library-features.md).
10
+
A C++ program can call on a large number of functions from this conforming implementation of the C++ Standard Library. These functions perform services such as input and output and provide efficient implementations of frequently used operations.
13
11
14
-
## In This Section
12
+
For more information about linking with the appropriate Visual C++ runtime .lib file, see [C Runtime (CRT) and C++ Standard Library .lib files](../c-runtime-library/crt-library-features.md).
13
+
14
+
## In this section
15
15
16
16
[C++ Standard Library Overview](../standard-library/cpp-standard-library-overview.md)\
17
17
Provides an overview of the Microsoft implementation of the C++ Standard Library.
0 commit comments