|
Including header files
How to prevent header files from being included twice?
My code is messed up and I need to include lots of .h files in other files so I get errors from the linker that X is already defined in x.obj file.
I tried using inclusion guards like this:
#ifndef INC_HEADER1
#define INC_HEADER1
<file content goes here>
#endif
and also tried
#pragma once
but i still get the same errors
But even if i include e.g windows.h or string.h a hundred times i never get linker errors about them.
help?
|