Skip to content

Commit 540fa2f

Browse files
authored
Merge pull request #2067 from MicrosoftDocs/master
6/3/2019 AM Publish
2 parents 28eae42 + 6a53379 commit 540fa2f

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

docs/build/reference/fp-name-dot-pch-file.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: "/Fp (Name .Pch File)"
3-
ms.date: "11/04/2016"
2+
title: "/Fp (Name .pch file)"
3+
description: "Use the /Fp compiler option to specify the precompiled header file name."
4+
ms.date: "05/31/2019"
45
f1_keywords: ["VC.Project.VCCLCompilerTool.PrecompiledHeaderFile", "/fp", "VC.Project.VCCLWCECompilerTool.PrecompiledHeaderFile"]
56
helpviewer_keywords: ["Fp compiler option [C++]", "-Fp compiler option [C++]", "naming precompiler header files", "PCH files, naming", "names [C++], PCH", ".pch files, naming", "precompiled header files, naming", "/Fp compiler option [C++]"]
67
ms.assetid: 0fcd9cbd-e09f-44d3-9715-b41efb5d0be2
78
---
8-
# /Fp (Name .Pch File)
9+
# /Fp (Name .pch file)
910

1011
Provides a path name for a precompiled header instead of using the default path name.
1112

@@ -15,39 +16,33 @@ Provides a path name for a precompiled header instead of using the default path
1516
1617
## Remarks
1718

18-
Use this option with [/Yc (Create Precompiled Header File)](yc-create-precompiled-header-file.md) or [/Yu (Use Precompiled Header File)](yu-use-precompiled-header-file.md) to provide a path name for a precompiled header instead of using the default path name. You can also use **/Fp** with **/Yc** to specify the use of a precompiled header file that differs from the **/Yc**<em>filename</em> argument and from the base name of the source file.
19+
Use the **/Fp** option with [/Yc (Create Precompiled Header File)](yc-create-precompiled-header-file.md) or [/Yu (Use Precompiled Header File)](yu-use-precompiled-header-file.md) to specify the path and file name for the precompiled header (PCH) file. By default, the **/Yc** option creates a PCH file name by using the base name of the source file and a *pch* extension.
1920

20-
If you do not specify an extension as part of the path name, an extension of .pch is assumed. If you specify a directory without a file name, the default file name is VC*x*0.pch, where *x* is the major version of Visual C++ in use.
21-
22-
You can also use the **/Fp** option with **/Yu**.
21+
If you don't specify an extension as part of the *pathname*, an extension of *pch* is assumed. When you specify a directory name by use of a slash (**/**) at the end of *pathname*, the default file name is vc*version*0.pch, where *version* is the major version of the Visual Studio toolset. This directory must exist, or error C1083 is generated.
2322

2423
### To set this compiler option in the Visual Studio development environment
2524

2625
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
2726

28-
1. Click the **C/C++** folder.
29-
30-
1. Click the **Precompiled Headers** property page.
27+
1. Open the **Configuration Properties** > **C/C++** > **Precompiled Headers** property page.
3128

32-
1. Modify the **Precompiled Header File** property.
29+
1. Modify the **Precompiled Header Output File** property.
3330

3431
### To set this compiler option programmatically
3532

36-
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.PrecompiledHeaderFile%2A>.
33+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
3734

38-
## Example
35+
## Examples
3936

40-
If you want to create a precompiled header file for a debugging version of your program and you are compiling both header files and source code, you can specify a command such as:
37+
To create a separate named version of the precompiled header file for the debug build of your program, you can specify a command such as:
4138

42-
```
39+
```CMD
4340
CL /DDEBUG /Zi /Yc /FpDPROG.PCH PROG.CPP
4441
```
4542

46-
## Example
43+
The following command specifies the use of a precompiled header file named MYPCH.pch. The compiler precompiles the source code in PROG.cpp through the end of MYAPP.h, and puts the precompiled code in MYPCH.pch. It then uses the content of MYPCH.pch and compiles the rest of PROG.cpp to create an .obj file. The output of this example is a file named PROG.exe.
4744

48-
The following command specifies the use of a precompiled header file named MYPCH.pch. The compiler assumes that the source code in PROG.cpp has been precompiled through MYAPP.h and that the precompiled code resides in MYPCH.pch. It uses the content of MYPCH.pch and compiles the rest of PROG.cpp to create an .obj file. The output of this example is a file named PROG.exe.
49-
50-
```
45+
```CMD
5146
CL /YuMYAPP.H /FpMYPCH.PCH PROG.CPP
5247
```
5348

0 commit comments

Comments
 (0)