Developer Guide and Reference

Contents

Yu

Tells the compiler to use a precompiled header file.

Syntax

Linux:
None
macOS:
None
Windows:
/Yu
[
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 use precompiled header files unless it is told to do so.
Description
This option tells the compiler to use a precompiled header (PCH) file.
It is supported for multiple source files when all source files use the same .pchi file.
The compiler treats all code occurring before the header file as precompiled. It skips to just beyond the #include directive associated with the header file, uses the code contained in the PCH file, and then compiles all code after
filename
.
If you do not specify
filename
, the compiler will use a PCH with a name based on the source file name. If you specify option
/Fp
, it will use the PCH specified by that option.
When this option is specified, the compiler ignores all text, including declarations preceding the #include statement of the specified file.
This option cannot be used in the same compilation as the
/Yc
option.
On Linux* and
macOS*
systems, option
/Yu
is equivalent to the
-pch-use
option.
Alternate Options
Linux and
macOS*
:
-pch-use
Windows: None
Consider the following command line:
icl /c /Yuheader.h bar.cpp
In this case, the name of the PCH file used is "header.pchi".
In the following command line, no filename is specified:
icl /Yu bar.cpp
In this case, the name of the PCH file used is "bar.pchi".
In the following command line, no filename is specified, but option
/Fp
is specified:
icl /Yu /Fpprecomp bar.cpp
In this case, the name of the PCH file used is "precomp.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