Developer Guide and Reference

Contents

Yc

Tells the compiler to create a precompiled header file.

Syntax

Linux:
None
macOS:
None
Windows:
/Yc
[
filename
]
Arguments
filename
Is the name of a C/C++ header file, which is included in the source file using an #include preprocessor directive.
Default
OFF
The compiler does not create or use precompiled headers unless you tell it to do so.
Description
This option tells the compiler to create a precompiled header (PCH) file. It is supported only for single source file compilations.
When
filename
is specified, the compiler creates a precompiled header file from the headers in the C/C++ program up to and including the C/C++ header specified.
If you do not specify
filename
, the compiler compiles all code up to the end of the source file, or to the point in the source file where a hdrstop occurs. The default name for the resulting file is the name of the source file with extension .pchi.
This option cannot be used in the same compilation as the
/Yu
option.
On Linux* and
macOS*
, option
/Yc
is equivalent to the
-pch-create
option.
Alternate Options
Linux and
macOS*
:
-pch-create
Windows: None
If option /Fp is used, it names the PCH file. For example, consider the following command lines:
icl /c /Ycheader.h /Fpprecomp foo.cpp icl /c /Yc /Fpprecomp foo.cpp
In both cases, the name of the PCH file is "precomp.pchi".
If the header file name is specified, the file name is based on the header file name. For example:
icl /c /Ycheader.h foo.cpp
In this case, the name of the PCH file is "header.pchi".
If no header file name is specified, the file name is based on the source file name. For example:
icl /c /Yc foo.cpp
In this case, the name of the PCH file is "foo.pchi".

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804