Skip to content

Commit 05c6e62

Browse files
Merge pull request #5175 from TylerMSFT/flag
call out colon form for /fo
2 parents 2a78545 + 33dfaf4 commit 05c6e62

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

docs/build/reference/fo-object-file-name.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
title: "/Fo (Object file name)"
33
description: "Reference guide to the Microsoft C++ /Fo (Object file name) compiler option in Visual Studio."
4-
ms.date: 12/12/2022
4+
ms.date: 01/29/2024
55
f1_keywords: ["/Fo", "VC.Project.VCCLCompilerTool.ObjectFile", "VC.Project.VCCLWCECompilerTool.ObjectFile"]
66
helpviewer_keywords: ["Fo compiler option [C++]", "object files, naming", "/Fo compiler option [C++]", "-Fo compiler option [C++]"]
7-
ms.assetid: 0e6d593e-4e7f-4990-9e6e-92e1dcbcf6e6
87
---
98
# `/Fo` (Object File Name)
109

1110
Specifies an object (*`.obj`*) file name or directory to be used instead of the default.
1211

1312
## Syntax
1413

15-
> **`/Fo`***`pathname`*
14+
> **`/Fo"pathname"`**\
15+
> **`/Fo:[ ]"pathname"`**
1616
1717
## Remarks
1818

@@ -26,6 +26,12 @@ To use the **`/Fo`** option to set an output directory for all object files crea
2626

2727
## Example
2828

29+
This command line demonstrates the format that allows for an optional space between the `/Fo` option and the *`pathname`* argument. It creates an object file named *`test.obj`* in the current directory.
30+
31+
```cmd
32+
CL /Fo: "test" /EHsc /c sample1.cpp
33+
```
34+
2935
The following command line creates object files named *`sample1.obj`* and *`sample2.obj`* in an existing directory, *`D:\intermediate\`*. It uses escaped backslash characters as path segment separators in a quoted path:
3036

3137
```cmd

docs/cpp/tutorial-import-stl-named-module.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ The statement `import std;` or `import std.compat;` imports the standard library
8383
| [`/c`](../build/reference/c-compile-without-linking.md) | Compile without linking, because we're just building the binary named module interface at this point. |
8484
8585
You can control the object file name and the named module interface file name with the following switches:
86-
- [`/Fo`](../build/reference/fo-object-file-name.md) sets the name of the object file. For example, `/Fo"somethingelse.obj"` (note: no space between the flag and the quote). By default, the compiler uses the same name for the object file as the module source file (`.ixx`) you're compiling. In the example, the object file name is `std.obj` by default because we're compiling the module file `std.ixx`.
86+
- [`/Fo`](../build/reference/fo-object-file-name.md) sets the name of the object file. For example, `/Fo:"somethingelse"`. By default, the compiler uses the same name for the object file as the module source file (`.ixx`) you're compiling. In the example, the object file name is `std.obj` by default because we're compiling the module file `std.ixx`.
8787
- [`/ifcOutput`](../build/reference/ifc-output.md) sets the name of the named module interface file (`.ifc`). For example, `/ifcOutput "somethingelse.ifc"`. By default, the compiler uses the same name for the module interface file (`.ifc`) as the module source file (`.ixx`) you're compiling. In the example, the generated `ifc` file is `std.ifc` by default because we're compiling the module file `std.ixx`.
8888
89-
1. Importing the `std` library you just built by first creating a file named `importExample.cpp` with the following content:
89+
1. Import the `std` library you built by first creating a file named `importExample.cpp` with the following content:
9090
9191
```cpp
9292
// requires /std:c++latest
@@ -161,10 +161,10 @@ Before you can use `import std.compat;` you must compile the module interface fi
161161
- `std.compat.obj` contains implementation. However, most of the implementation is provided by `std.obj`. Add `std.obj` to the command line when you compile the sample app to statically link the functionality that you use from the standard library into your application.
162162
163163
You can control the object file name and the named module interface file name with the following switches:
164-
- [`/Fo`](../build/reference/fo-object-file-name.md) sets the name of the object file. For example, `/Fo"somethingelse.obj"` (note: no space between the flag and the quote). By default, the compiler uses the same name for the object file as the module source file (`.ixx`) you're compiling. In the example, the object file names are `std.obj` and `std.compat.obj` by default because we're compiling the module files `std.ixx` and `std.compat.obj`.
164+
- [`/Fo`](../build/reference/fo-object-file-name.md) sets the name of the object file. For example, `/Fo:"somethingelse"`. By default, the compiler uses the same name for the object file as the module source file (`.ixx`) you're compiling. In the example, the object file names are `std.obj` and `std.compat.obj` by default because we're compiling the module files `std.ixx` and `std.compat.obj`.
165165
- [`/ifcOutput`](../build/reference/ifc-output.md) sets the name of the named module interface file (`.ifc`). For example, `/ifcOutput "somethingelse.ifc"`. By default, the compiler uses the same name for the module interface file (`.ifc`) as the module source file (`.ixx`) you're compiling. In the example, the generated `ifc` files are `std.ifc` and `std.compat.ifc` by default because we're compiling the module files `std.ixx` and `std.compat.ixx`.
166166
167-
1. Try out importing the `std.compat` library by first creating a file named `stdCompatExample.cpp` with the following content:
167+
1. Import the `std.compat` library by first creating a file named `stdCompatExample.cpp` with the following content:
168168
169169
```cpp
170170
import std.compat;

0 commit comments

Comments
 (0)