13.1 Preprocessor error messages
No such file or directory
This error occurs if GCC cannot find a requested file on its search
path. The file may have been specified on the command-line, or with a
#include statement. Either the filename has been
spelled incorrectly or the directory for the file needs to be added to the
include path or link path.
#include <stdoi.h> /* incorrect */
printf ("Hello World!\n");
The program above tries to include the non-existent file 'stdoi.h'
giving the error 'stdoi.h: No such file or directory'. The correct
filename should be 'stdio.h'.
macro or '#include' recursion too deep
#include nested too deeply
This error occurs if the preprocessor encounters too many nested
'#include' directives. It is usually caused by two or more files
trying to include each other, leading to an infinite recursion.
/* foo.h */
/* bar.h */
The solution to this problem is to ensure that files do not mutually
include each other, or to use "include guards" (see section 7.4.2 Providing your own templates for an example).
invalid preprocessing directive #...
This error indicates that the preprocessor encountered an unrecognized
int x = 1;
#elsif BAR /* should be #elif */
int x = 2;
int x = 3;
The preprocessor syntax requires
#elif for the "else if" condition in
#if blocks, rather than
#elseif. In the example above
an invalid directive error occurs at the incorrect usage
#elseif, but only when
FOO is defined (otherwise the
preprocessor ignores everything up to the
warning: This file includes at least one deprecated or antiquated header.
This warning is generated for C++ programs which include old-style
library header files, such as 'iostream.h', instead of the modern
C++ library headers without the '.h' extension. The old headers
import their functions into the top-level global namespace, instead of
std:: namespace. Note that old-style header files are
still supported, so this message is only a warning and existing programs
will continue to compile. The message is actually generated by a
#warning directive in the old header files, and not by the
#include <iostream.h> /* old style */
cout << "Hello World!\n";
This program uses an old-style header file 'iostream.h'. It could
be updated to use
#include <iostream> and