Skip to content

Commit eebed43

Browse files
TylerMSFTTylerMSFT
authored andcommitted
acrolinx
1 parent 4318250 commit eebed43

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

docs/c-runtime-library/c-run-time-library-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["CRT", "runtime libraries", "CRT, reference"]
77
---
88
# Microsoft C runtime library (CRT) reference
99

10-
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.
10+
The Microsoft runtime library provides routines for programming the Microsoft Windows operating system. These routines automate many common programming tasks that are not provided by the C and C++ languages.
1111

1212
Sample programs are included in the individual reference topics for most routines in the library.
1313

@@ -37,8 +37,8 @@ Provides links to the C runtime library functions, organized by function family.
3737
[Language and country/region strings](locale-names-languages-and-country-region-strings.md)\
3838
Describes how to use the `setlocale` function to set the language and Country/Region strings.
3939

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.
40+
[C Runtime (CRT) and C++ Standard Library `.lib` files](crt-library-features.md)\
41+
Discusses the `.lib` files that make up the C runtime libraries and their associated compiler options and preprocessor directives.
4242

4343
## Related Sections
4444

docs/c-runtime-library/crt-library-features.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ ms.date: "3/5/2021"
55
ms.topic: "reference"
66
helpviewer_keywords: ["MSVCR71.dll", "libraries [C++], multithreaded", "library files, run-time", "LIBCMT.lib", "LIBCP.lib", "LIBCPMT.lib", "run-time libraries, C", "CRT, release versions", "MSVCP71.dll", "LIBC.lib", "libraries [C++]", "libraries [C++], run-time", "linking [C++], libraries"]
77
---
8-
# C Runtime (CRT) and C++ Standard Library .lib files
8+
# C Runtime (CRT) and C++ Standard Library `.lib` files
99

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.
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.
1111

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.
12+
See [Redistributing Visual C++ files](../windows/redistributing-visual-cpp-files.md) if you're looking for information about deploying the C runtime files necessary to support your application.
1313

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.
14+
See [C runtime library reference](../c-runtime-library/c-run-time-library-reference.md) if you're looking for API reference for the C runtime library.
1515

16-
## C runtime .lib files
16+
## C runtime `.lib` files
1717

1818
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.
1919

@@ -28,7 +28,7 @@ The following table lists the libraries that implement the UCRT.
2828
| *`ucrt.lib`* | *`ucrtbase.dll`* | DLL import library for the UCRT. | **`/MD`** | `_MT`, `_DLL` |
2929
| *`ucrtd.lib`* | *`ucrtbased.dll`* | DLL import library for the Debug version of the UCRT. Not redistributable. | **`/MDd`** | `_DEBUG`, `_MT`, `_DLL` |
3030

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.
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're using.
3232

3333
This table lists the libraries that implement the vcruntime library.
3434

@@ -41,9 +41,9 @@ This table lists the libraries that implement the vcruntime library.
4141

4242
> [!NOTE]
4343
> When the UCRT was refactored, the Concurrency Runtime functions were moved into
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.
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 doesn't have condition variables.
4545

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.
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's specific to the version of the compiler used. This library is always statically linked, even when using a dynamically linked UCRT.
4747

4848
This table lists the libraries that implement CRT initialization and termination.
4949

@@ -60,19 +60,19 @@ This table lists the libraries that implement CRT initialization and termination
6060

6161
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`*.
6262

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.
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 doesn't apply if you use the new more secure versions of these functions; for example, `strtok_s` doesn't have this problem.
6464

6565
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.
6666

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.
67+
If you're 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.
6868

6969
For more information on using the CRT with **`/clr`**, see [Mixed (Native and Managed) Assemblies](../dotnet/mixed-native-and-managed-assemblies.md).
7070

7171
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).
7272

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.
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 aren't 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.
7474

75-
## C++ Standard Library .lib files
75+
## C++ Standard Library `.lib` files
7676

7777
| C++ Standard Library | Characteristics | Option | Preprocessor directives |
7878
|--|--|--|--|
@@ -87,11 +87,11 @@ When you build a release version of your project, one of the basic C runtime lib
8787
#include <ios>
8888
```
8989

90-
For binary compatibility, more than one DLL file may be specified by a single import library. Version updates may introduce *dot libraries*, separate DLLs that introduce new library functionality. For example, Visual Studio 2017 version 15.6 introduced *`msvcp140_1.dll`* to support additional standard library functionality without breaking the ABI supported by *`msvcp140.dll`*. The *`msvcprt.lib`* import library included in the toolset for Visual Studio 2017 version 15.6 supports both DLLs, and the vcredist for this version installs both DLLs. Once shipped, a dot library has a fixed ABI, and will never have a dependency on a later dot library.
90+
For binary compatibility, more than one DLL file may be specified by a single import library. Version updates may introduce *dot libraries*, separate DLLs that introduce new library functionality. For example, Visual Studio 2017 version 15.6 introduced *`msvcp140_1.dll`* to support additional standard library functionality without breaking the Application Binary Interface (ABI) supported by *`msvcp140.dll`*. The *`msvcprt.lib`* import library included in the toolset for Visual Studio 2017 version 15.6 supports both DLLs, and the vcredist for this version installs both DLLs. Once shipped, a dot library has a fixed ABI, and will never have a dependency on a later dot library.
9191

9292
## What problems exist if an application uses more than one CRT version?
9393

94-
Every executable image (EXE or DLL) can have its own statically linked CRT, or can dynamically link to a CRT. The version of the CRT statically included in or dynamically loaded by a particular image depends on the version of the tools and libraries it was built with. A single process may load multiple EXE and DLL images, each with its own CRT. Each of those CRTs may use a different allocator, may have different internal structure layouts, and may use different storage arrangements. This means that allocated memory, CRT resources, or classes passed across a DLL boundary can cause problems in memory management, internal static usage, or layout interpretation. For example, if a class is allocated in one DLL but passed to and deleted by another, which CRT deallocator is used? The errors caused can range from the subtle to the immediately fatal, and therefore direct transfer of such resources is strongly discouraged.
94+
Every executable image (EXE or DLL) can have its own statically linked CRT, or can dynamically link to a CRT. The version of the CRT statically included in or dynamically loaded by a particular image depends on the version of the tools and libraries it was built with. A single process may load multiple EXE and DLL images, each with its own CRT. Each of those CRTs may use a different allocator, may have different internal structure layouts, and may use different storage arrangements. This means allocated memory, CRT resources, or classes passed across a DLL boundary can cause problems in memory management, internal static usage, or layout interpretation. For example, if a class is allocated in one DLL but passed to and deleted by another, which CRT deallocator is used? The errors caused can range from the subtle to the immediately fatal, and therefore direct transfer of such resources is strongly discouraged.
9595

9696
You can avoid many of these issues by using Application Binary Interface (ABI) technologies instead, as they are designed to be stable and versionable. Design your DLL export interfaces to pass information by value, or to work on memory that is passed in by the caller rather than allocated locally and returned to the caller. Use marshaling techniques to copy structured data between executable images. Encapsulate resources locally and only allow manipulation through handles or functions you expose to clients.
9797

docs/standard-library/cpp-standard-library-reference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ helpviewer_keywords: ["C++ Standard Library, reference", "C++ Standard Library",
99

1010
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.
1111

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).
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).
1313

1414
## In this section
1515

16-
[C++ Standard Library Overview](../standard-library/cpp-standard-library-overview.md)\
16+
[C++ Standard Library overview](../standard-library/cpp-standard-library-overview.md)\
1717
Provides an overview of the Microsoft implementation of the C++ Standard Library.
1818

19-
[iostream Programming](../standard-library/iostream-programming.md)\
20-
Provides an overview of iostream programming.
19+
[`iostream` Programming](../standard-library/iostream-programming.md)\
20+
Provides an overview of `iostream` programming.
2121

22-
[Header Files Reference](../standard-library/cpp-standard-library-header-files.md)\
23-
Provides links to reference topics discussing the C++ Standard Library header files, with code examples.
22+
[Header files reference](../standard-library/cpp-standard-library-header-files.md)\
23+
Provides links to reference topics about the C++ Standard Library header files, with code examples.

0 commit comments

Comments
 (0)