Use include guard:
#ifndef INCLUDE_GUARD_IDENTIFIER_GOES_HERE
#define INCLUDE_GUARD_IDENTIFIER_GOES_HERE
#endif
The second time it turned on, it is actually an empty file.
There are many different ways to select an identifier INCLUDE_GUARD_IDENTIFIER_GOES_HERE, with justifications for each. Personally, I do FILE_DIRECTORY_FILE_NAME_CLASS/FUNCTION_NAME_HPP:
#ifndef UTILITY_FOO_HPP
#define UTILITY_FOO_HPP
namespace utility
{
void foo();
}
#endif
Others will generate a GUID and attach them to the base name, for example:
INCLUDE_GUARD_A629F54A136C49C9938CB33EF8EDE676
, . , . , , , , : , .