Developer Documentation
PATH  Mac OS X Documentation > The GNU C Preprocessor

The GNU C Preprocessor

Previous | Contents | Next

Troubleshooting

To use precompiled headers you must have the cpp-precomp preprocessor and parser, which has several incompatibilities with the standard GNU C preprocessor and parser. For example, preprocessing errors and syntax errors are in a slightly different format.

Only rarely will you have trouble building a precompiled header. The most common problem you might encounter is that the header doesn't parse; this is often because the header does not include other headers it depends on, so that there are undefined types. Another typical problem is conflicting definitions, which can be solved by renaming identifiers or removing a header from the precompiled header.

The following list describes the compile-time warnings that may occur when using a precompiled header:

The precompiled header could not be used for one of the reasons below.

The macro was defined when the precompiled header was built, but is not defined in the current context.

The macro was undefined when the precompiled header was built, but is defined in the current context. This error can often be avoided by importing precompiled headers in the source file before any other headers.

A previously included precompiled header defines a macro differently than does the current precompiled header being processed.

Similar to the previous warning, except that the earlier definition of the macro occurred on the command line (with the -D flag).

The macro has been defined in two different ways in two different precompiled headers

A symbol was defined for the inclusion of this precompiled header, but was not when the header was precompiled. Since this symbol is used in an #ifdef, the precompiled header does not contain all the source code desired by the including context.

The modification time of the header on the disk does not match the modification time of the header when the precompiled header was built.

The header which was included by the precompiled header could not be found on the disk to verify its modification time.

It was discovered that the version of the referenced precompiled header is incompatible with the compiler, possibly signifying a corrupt or obsolete header.p .


The GNU C Preprocessor

Previous | Contents | Next