If you have an #include file that should be #included only once, use a sequence like #ifndef H_FOOHEADER #define H_FOOHEADER ... main header file contents #endif The #endif should be in the last line of the file, and this line should only contain the #endif and whitespace and/or comments. If this line is terminated by a single newline, which is the default on unix systems, the preprocessor will recognize this construct and need not even bother to skip through the main body of your header file when it reencounters it.