Creating Precompiled Header Files

Home

The Microsoft C and C++ compilers provide options for precompiling any C or C++ code—including inline code. Using this performance feature, you can compile a stable body of code, store the compiled state of the code in a file, and during subsequent compilations combine the precompiled code with code that is still under development. Each subsequent compilation is faster because the stable code does not need to be recompiled.

Visual C++ offers two ways to create and use precompiled header files:

With Microsoft Visual C++, you can precompile any C or C++ code; you are not limited to precompiling only header files. To precompile headers, you can choose one of two approaches:

The first choice is quick and easy. The second requires some planning, but it offers significantly faster compilations if you precompile source code other than simple header files.

What do you want to know more about?