Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - using precompiled headers reduces compilation time when: http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Using precompiled headers reduces compilation time when:

 .  You always use a large body of code that changes infrequently.
 .  Your program comprises multiple modules, all of which use the same first
    include file and the same compilation options.  In this case, the first
    include file along with all the files that it includes can be
    precompiled into one precompiled header.

Because the compiler only uses the first include file to create a
precompiled header, you may want to create a master or global header file
that includes all the other header files that you wish to have precompiled.
Then all source files should include this master header file as the first
#include in the source file.  Even if you don't use a master header file,
you can benefit from using precompiled headers for Windows programs by using
#include <windows.h> as the first include file, or by using #include
<afxwin.h> as the first include file for MFC applications.

The first compilation - the one that creates the precompiled header file -
takes a bit longer than subsequent compilations.  Subsequent compilations
can proceed more quickly by including the precompiled header.

You can precompile C and C++ programs.  In C++ programming, it is common
practice to separate class interface information into header files which can
later be included in programs that use the class.  By precompiling these
headers, you can reduce the time a program takes to compile.

+--------------------------------------------------------------------------+
|   Note:  Although you can use only one precompiled header (.PCH) file    |
| per source file, you can use multiple .PCH files in a project.           |
+--------------------------------------------------------------------------+

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson