description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||
---|---|---|---|---|---|---|---|---|---|---|
Learn more about: `/Fi` (Preprocess output file name) |
/Fi (Preprocess Output File Name) |
08/12/2020 |
|
|
6d0ba983-a8b7-41ec-84f5-b4688ef8efee |
Specifies the name of the output file to which the /P
(Preprocess to a File) compiler option writes preprocessed output.
/Fi
pathname
pathname
The relative or absolute path and filename of the output file produced by the /P
compiler option. Or, the directory path for the .i
output files when more than one input file is specified. Don't put a space between the /Fi
option and pathname
.
Use the /Fi
compiler option in combination with the /P
compiler option. If /P
isn't specified, /Fi
causes command line warning D9007.
If you specify only a directory path (a path that ends in a backslash \
) for the pathname
parameter, the base name of the source file is used as the base name of the preprocessed output file. The pathname
parameter doesn't require a particular file name extension. However, an extension of ".i" is used if you don't specify a file name extension.
The following command line preprocesses PROGRAM.cpp
, preserves comments, adds #line
directives, and writes the result to the MYPROCESS.i
file:
CL /P /FiMYPROCESS.I PROGRAM.CPP
This command line preprocesses main.cpp
and helper.cpp
into main.i
and helper.i
in a subdirectory named preprocessed
:
CL /P /Fi".\\preprocessed\\" main.cpp helper.cpp
-
Open the source file or the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
-
Select the Configuration Properties > C/C++ > Preprocessor property page.
-
Set the Preprocess to a File property to Yes.
-
Select the Configuration Properties > C/C++ > Command Line property page.
-
Enter the
/Fi
compiler option andpathname
in the Additional Options box. Only specify a directory path, not a filename, when setting this property for a project.
- See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A.
MSVC compiler options
/P
(Preprocess to a file)
Specifying the pathname