### Create Precompiled Header Files

To create a precompiled header file, the compiler process must have write permission to the directories you specify, or to the current working directories if none are specified.

Create a Precompiled Header
To automatically create and maintain precompiled header files, use the /Fi and /Si compiler options together. Precompiled header files will be created if they do not exist, and will be used if they do. When a source file changes, the precompiled version is automatically regenerated.

Create Multiple Precompiled Headers
There are two ways you can specify the name of an additional precompiled header file, or an alternative directory to search:

- Use the /Fi and /Si compiler options on the command line. If the options specify different filenames, the compiler uses the last one specified for both options.
- Use #pragma hdrfile in the source file, before the first include directive. The pragma only takes effect if you specify one of /Fi or /Si.

Filenames specified with the pragma take precedence over those specified with the options.

The default filenames are:

- csetc.pch for C compiles
- csetcpp.pch for C++ compiles

The default directory is the current working directory.

Precompiled Headers
Initial Sequence of Headers

Use Precompiled Header Files

Examples of Using Compiler Options and #pragma hdrfile