Skip to content

Commit a36e58b

Browse files
authored
Merge pull request #4302 from MicrosoftDocs/main638047385039907684sync_temp
Repo sync for protected CLA branch
2 parents 3f2ff11 + 4d74477 commit a36e58b

10 files changed

+327
-22
lines changed

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
111111
| [`/homeparams`](homeparams-copy-register-parameters-to-stack.md) | Forces parameters passed in registers to be written to their locations on the stack upon function entry. This compiler option is only for the x64 compilers (native and cross compile). |
112112
| [`/hotpatch`](hotpatch-create-hotpatchable-image.md) | Creates a hotpatchable image. |
113113
| [`/I<dir>`](i-additional-include-directories.md) | Searches a directory for include files. |
114-
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
114+
| [`/ifcOutput`](ifc-output.md) | Specify output file name or directory for built *`.ifc`* files. |
115115
| [`/interface`](interface.md) | Treat the input file as a module interface unit. |
116116
| [`/internalPartition`](internal-partition.md) | Treat the input file as an internal partition unit. |
117117
| [`/J`](j-default-char-type-is-unsigned.md) | Changes the default **`char`** type. |

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ This article contains a categorical list of compiler options. For an alphabetica
137137
| [`/exportHeader`](module-exportheader.md) | Create the header units files (*`.ifc`*) specified by the input arguments. |
138138
| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (*`.ifc`*) for the specified header. |
139139
| [`/headerName`](headername.md) | Build a header unit from the specified header. |
140-
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
140+
| [`/ifcOutput`](ifc-output.md) | Specify the output file name or directory for built *`.ifc`* files. |
141141
| [`/interface`](interface.md) | Treat the input file as a module interface unit. |
142142
| [`/internalPartition`](internal-partition.md) | Treat the input file as an internal partition unit. |
143143
| [`/reference`](module-reference.md) | Use named module IFC. |

docs/build/reference/ifc-output.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "/ifcOutput"
3+
description: "Specify output file or directory for `.ifc` files."
4+
ms.date: 11/21/2022
5+
author: "tylermsft"
6+
ms.author: "twhitney"
7+
f1_keywords: ["/ifcOutput", "VC.Project.VCCLCompilerTool.ifcOutput"]
8+
helpviewer_keywords: ["/ifcOutput", "Specify where the compiled `.ifc` should go"]
9+
---
10+
# `/ifcOutput`
11+
12+
This switch tells the compiler where to output built *`.ifc`* files. If the destination is a directory, then the compiler generates the name of each `.ifc` file based on the interface name or the header unit name.
13+
14+
## Syntax
15+
16+
> **`/ifcOutput`** *`filename`*\
17+
> **`/ifcOutput`** *`directory\`*
18+
19+
## Remarks
20+
21+
By default, the compiler derives the name for each generated *`.ifc`* file from the module interface name. For example, given a module name `MyModule`, the generated *`.ifc`* will be named *`MyModule.ifc`*, unless you override the name with the `/ifcOutput` switch.
22+
23+
Use this switch to specify an alternative *`.ifc`* filename or directory. If you want to use the default built *`.ifc`* filenames, but specify a directory where they should be built, ensure that you add a trailing backslash (`\`) to the directory name.
24+
25+
When you're building multiple *`.ifc`* files, only use the directory form of the `/ifcOutput` switch. If you provide multiple `/ifcOutput` switches, the compiler only uses the last one.
26+
27+
If you build with the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) switch, we recommend that you use the directory form of the `/ifcOutput` switch if you have multiple input module files.
28+
29+
In the following example, the *`.ifc`* file for module `m` defined in *`m.ixx`* is built as `c:\example\m.ifc`.
30+
31+
```bash
32+
cl ... /c /std:c++latest m.ixx /ifcOutput c:\example\
33+
```
34+
35+
In the following example, the built *`.ifc`* file for module `m` defined in *`m.ixx`** is built as `c:\example\MyModule.ifc`:
36+
37+
```bash
38+
cl ... /c /std:c++latest m.ixx /ifcOutput c:\example\MyModule.ifc
39+
```
40+
41+
### To set this compiler option in the Visual Studio development environment
42+
43+
1. To apply the **`/ifcOutput`** option to one file in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the **Property Pages** dialog.
44+
45+
1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
46+
47+
1. Open the **Configuration Properties** > **C/C++** > **Output Files** property page.
48+
49+
1. Use the dropdown control to modify the **Module Output File Name** property to a directory name (ending in `\`) or an alternate file name. Or you can specify a directory + file name, for example, `c:\example\mymodule.ifc`. Choose **OK** or **Apply** to save your changes.
50+
51+
Alternatively, you can specify the `/ifcOutput` switch with a right-click on the project name in the **Solution Explorer** > **Configuration Properties** > **C/C++** > **Command Line**.
52+
53+
## See also
54+
55+
[Overview of modules in C++](../../cpp/modules-cpp.md)\
56+
[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)

docs/build/toc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,11 @@ items:
616616
href: ../build/reference/hotpatch-create-hotpatchable-image.md
617617
- name: /I (Additional include directories)
618618
href: ../build/reference/i-additional-include-directories.md
619-
- name: /interface (treat input file as a module interface unit)
619+
- name: /ifcOutput (Specify where the compiled `.ifc` should go.)
620+
href: ../build/reference/ifc-output.md
621+
- name: /interface (Treat input file as a module interface unit)
620622
href: ../build/reference/interface.md
621-
- name: /internalPartition (treat the input file as an internal partition unit.)
623+
- name: /internalPartition (Treat the input file as an internal partition unit.)
622624
href: ../build/reference/internal-partition.md
623625
- name: /J (Default char type is unsigned)
624626
href: ../build/reference/j-default-char-type-is-unsigned.md

docs/build/walkthrough-header-units.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ monikerRange: '>=msvc-160'
1111

1212
# Walkthrough: Build and import header units in Microsoft Visual C++
1313

14-
This article is about building and importing header units with Visual Studio 2022. To learn how to import Standard Template Library headers as header units, see [Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md).
14+
This article is about building and importing header units with Visual Studio 2022. To learn how to import C++ standard library headers as header units, see [Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md). For an even faster and more robust way to import the standard library, see [Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md).
1515

1616
Header units are the recommended alternative to [precompiled header files](creating-precompiled-header-files.md) (PCH). Header units are easier to set up and use, are significantly smaller on disk, provide similar performance benefits, and are more flexible than a [shared PCH](https://devblogs.microsoft.com/cppblog/shared-pch-usage-sample-in-visual-studio).
1717

@@ -49,7 +49,7 @@ There are several ways to compile a file into a header unit:
4949

5050
- **Automatically scan for and build header units**. This approach is convenient, but is best suited to smaller projects because it doesn't guarantee optimal build throughput. For details about this approach, see [Approach 2: Automatically scan for header units](#approach2).
5151

52-
- As mentioned in the introduction, you can build and import STL header files as header units and automatically treat `#include` for STL library headers as `import` without rewriting your code. To see how, visit [Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md).
52+
- As mentioned in the introduction, you can build and import STL header files as header units, and automatically treat `#include` for STL library headers as `import` without rewriting your code. To see how, visit [Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md).
5353

5454
## <a name="approach1"></a>Approach 1: Translate a specific file into a header unit
5555

@@ -157,4 +157,5 @@ Enabling the new preprocessor affects the processing of variadic macros. For mor
157157
[`/headerUnit`](./reference/headerunit.md)\
158158
[`header-units.json`](./reference/header-unit-json-reference.md)\
159159
[Overview of modules in C++](../cpp/modules-cpp.md)\
160+
[Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md)\
160161
[Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md#approach1)

docs/build/walkthrough-import-stl-header-units.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ monikerRange: '>=msvc-160'
1010
---
1111
# Walkthrough: Import STL libraries as header units
1212

13-
This walkthrough shows how to import C++ Standard Template Library (STL) libraries as header units in Visual Studio.
13+
This walkthrough shows how to import C++ Standard Template Library (STL) libraries as header units in Visual Studio. For an even faster and more robust way to import the standard library, see [Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md).
1414

1515
Importing an STL header as a header unit is simpler than using [precompiled header files](creating-precompiled-header-files.md). Header units are easier to set up and use, are substantially smaller on disk, provide similar performance benefits, and are more flexible than a [shared PCH](https://devblogs.microsoft.com/cppblog/shared-pch-usage-sample-in-visual-studio).
1616

@@ -219,5 +219,6 @@ The main consideration for whether to use this approach is the balance between c
219219
220220
## See also
221221
222-
[Walkthrough: Build and import header units in your Visual C++ projects](walkthrough-header-units.md) \
222+
[Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md)\
223+
[Walkthrough: Build and import header units in your Visual C++ projects](walkthrough-header-units.md)\
223224
[`/translateInclude`](./reference/translateinclude.md)

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: "C runtime (CRT) and C++ Standard Library (STL) lib files"
3-
description: "List of Microsoft C runtime and C++ Standard Library (STL) lib files that you can link against and their associated compiler options and preprocessor directives."
2+
title: "C runtime (CRT) and C++ standard library (STL) lib files"
3+
description: "List of Microsoft C runtime and C++ standard library (STL) lib files that you can link against and their associated compiler options and preprocessor directives."
44
ms.date: "3/5/2021"
55
ms.topic: "reference"
66
ms.custom: contperf-fy21q3
77
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", "STL libraries", "Microsoft standard template libraries"]
88
---
9-
# C runtime (CRT) and C++ Standard Library (STL) `.lib` files
9+
# C runtime (CRT) and C++ standard library (STL) `.lib` files
1010

1111
This article 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.
1212

@@ -15,13 +15,13 @@ See [Redistributing Visual C++ files](../windows/redistributing-visual-cpp-files
1515
See [C runtime library reference](./c-run-time-library-reference.md) if you're looking for API reference for the C runtime library.
1616

1717
>[!NOTE]
18-
> Microsoft's implementation of the C++ Standard Library is often referred to as the *STL* or *Standard Template Library*. Although *C++ Standard Library* is the official name of the library as defined in ISO 14882, due to the popular use of "STL" and "Standard Template Library" in search engines, we occasionally use those names to make it easier to find our documentation.
18+
> Microsoft's implementation of the C++ standard library is often referred to as the *STL* or *Standard Template Library*. Although *C++ standard library* is the official name of the library as defined in ISO 14882, due to the popular use of "STL" and "Standard Template Library" in search engines, we occasionally use those names to make it easier to find our documentation.
1919
20-
From a historical perspective, "STL" originally referred to the Standard Template Library written by Alexander Stepanov. Parts of that library were standardized in the C++ Standard Library. The Standard Library also incorporated the ISO C runtime library, parts of the Boost library, and other functionality. Sometimes "STL" is used to refer to the containers and algorithms parts of the C++ Standard Library adapted from Stepanov's STL. In this documentation, Standard Template Library (STL) refers to the C++ Standard Library as a whole.
20+
From a historical perspective, "STL" originally referred to the Standard Template Library written by Alexander Stepanov. Parts of that library were standardized in the C++ standard library. The standard library also incorporates the ISO C runtime library, parts of the Boost library, and other functionality. Sometimes "STL" is used to refer to the containers and algorithms parts of the C++ standard library adapted from Stepanov's STL. In this documentation, Standard Template Library (STL) refers to the C++ standard library as a whole.
2121

2222
## C runtime `.lib` files
2323

24-
The C runtime Library (CRT) is the part of the C++ Standard Library that incorporates the ISO C 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.
24+
The ISO C standard library is part of the C++ 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.
2525

2626
In Visual Studio 2015, the CRT was 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 and later versions. The static library, DLL import library, and header files for the UCRT are now found in the Windows SDK. When you install Visual C++, Visual Studio setup installs the subset of the Windows 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 or later. For more information, see [Redistributing Visual C++ Files](../windows/redistributing-visual-cpp-files.md).
2727

@@ -47,7 +47,7 @@ This table lists the libraries that implement the vcruntime library.
4747

4848
> [!NOTE]
4949
> When the UCRT was refactored, the Concurrency Runtime functions were moved into
50-
*`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.
50+
*`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.
5151

5252
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.
5353

@@ -78,16 +78,16 @@ To build a debug version of your application, the [`_DEBUG`](./debug.md) flag mu
7878

7979
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.
8080

81-
## C++ Standard Library (STL) `.lib` files
81+
## C++ standard library (STL) `.lib` files
8282

83-
| C++ Standard Library | Characteristics | Option | Preprocessor directives |
83+
| C++ standard library | Characteristics | Option | Preprocessor directives |
8484
|--|--|--|--|
8585
| *`libcpmt.lib`* | Multithreaded, static link | **`/MT`** | `_MT` |
8686
| *`msvcprt.lib`* | Multithreaded, dynamic link (import library for *`msvcp<version>.dll`*) | **`/MD`** | `_MT`, `_DLL` |
8787
| *`libcpmtd.lib`* | Multithreaded, static link | **`/MTd`** | `_DEBUG`, `_MT` |
8888
| *`msvcprtd.lib`* | Multithreaded, dynamic link (import library for *`msvcp<version>d.dll`*) | **`/MDd`** | `_DEBUG`, `_MT`, `_DLL` |
8989

90-
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:
90+
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:
9191

9292
```cpp
9393
#include <ios>

0 commit comments

Comments
 (0)