When you compile source files, the included header files are
also compiled. If a header file is included in more than one source
file, it is recompiled when each source file is compiled. Also, you
might include header files that introduce many lines of code, but
the primary source files that include them are relatively small.
Therefore, it is often desirable to avoid recompiling a set of header
files by precompiling them. These are referred to as PCH files.
By default, when the compiler creates a PCH file, it:
takes the name of the primary
source file and replaces the suffix with .pch
creates the file in the same directory as the primary
source file.
Note
Support for PCH processing is not available when you specify
multiple source files in a single compilation. In such a case, the
compiler issues an error message and aborts the compilation.
Note
Do not assume that if a PCH file is available, it is used
by the compiler. In some cases, system configuration issues mean
that the compiler might not always be able to use the PCH file.
The compiler can precompile header files automatically, or
enable you to control the precompilation.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.