[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Using Precompiled or Preprocessed Headers

Source code files in a project typically use many header files (".h" or ".hpp" files). Often, several different source-code files include the same header file, forcing the compiler to (inefficiently) read the same header file many times during the compilation process. Many programming languages support precompiled headers, including C and C++.
To shorten the time spent compiling and recompiling a header file, use the Precompile command in the Project Menu. A precompiled header file takes the compiler significantly less time to process than an ordinary, uncompiled header file.
For instance, a header file that contains the most frequently used headers in your project could be made into one precompiled header file. Instead of having to compile the same thousands of lines of header files for each source file in your project, the compiler only has to load one precompiled header file.
WARNING!
You can only include one precompiled header in a source file. Including more than one precompiled header results in an error. If an error occurs, try including the precompiled header as a prefix file.
TIP
The precompiled header format frequently changes in order to accommodate new features in CodeWarrior IDE updates. Therefore, precompiled header formats are often incompatible between different IDE versions. After installing a new CodeWarrior IDE update, you usually need to update your precompiled headers to use the new format. You can also configure your precompiled headers to automatically update to the new format. See "Automatic updating" for more information.
The topics in this section are:
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 17, 2000