No such file or directory
#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.
Example:
#include <stdoi.h> /* incorrect */ int main (void) { printf ("Hello World!\n"); return 0; }
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
Example:
/* foo.h */ #include "bar.h" ...
/* bar.h */ #include "foo.h" ...
The solution to this problem is to ensure that files do not mutually
include each other, or to use “include guards” (see Providing your own templates for an example).
invalid preprocessing directive #...
#
command.
Example:
#if FOO int x = 1; #elsif BAR /* should be #elif */ int x = 2; #else int x = 3; #endif
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 #else
statement).
warning: This file includes at least one deprecated or antiquated header.
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
preprocessor itself.
Example:
#include <iostream.h> /* old style */ int main (void) { cout << "Hello World!\n"; return 0; }
This program uses an old-style header file iostream.h. It could
be updated to use #include <iostream>
and std::cout
instead.