Extra tokens at end of pound include directive

From Cppsyntax

Jump to: navigation, search

One easy way to get the message

 extra tokens at end of #include directive

is to put a semicolon at the end of the line:

WRONG

 #include "foo.h";

RIGHT

 #include "foo.h"

While C and C++ statements need semicolons after them, #-directives (including #includes) do not.

Personal tools