What the header guards are doing is not to prevent multiple inclusion in a project, but in a single translation unit only.
For example, lets say you have two header files, a.h
and b.h
. The header file b.h
includes a.h
, and then both a.h
and b.h
is included in the source file s.c
. Without header guards the file a.h
will be included twice, which can cause errors. If the header files had header guards then the file a.h
would only be included once.
You don't need header guards in source files because usually you don't include them in other files.