#include drives me crazy
Posted: Tue May 31, 2005 8:28 pm
Sure, this no Irrlich specific question but due to the good experience with the community I post this in the hope of a hint.
Situation:
I've two classes (classA and classB) Both are implemented in a cpp file and both having a header file.
Further more is classA using classB and vice versa. To accomplish this I need to include classA.h in classB.h and vice versa.
But this means to set up an eternal "include-loop" between the two headers.
Consequently my compiler (VC2003) is not very amused about this try.
I've tried a lot (even browsing a book about C++) but without success.
The A-uses-B and B-uses-A situation isn’t so odd, isn’t it?
So my question:
How to deal with such a situation?
Thanks
Thorsten
Situation:
I've two classes (classA and classB) Both are implemented in a cpp file and both having a header file.
Further more is classA using classB and vice versa. To accomplish this I need to include classA.h in classB.h and vice versa.
But this means to set up an eternal "include-loop" between the two headers.
Consequently my compiler (VC2003) is not very amused about this try.
I've tried a lot (even browsing a book about C++) but without success.
The A-uses-B and B-uses-A situation isn’t so odd, isn’t it?
So my question:
How to deal with such a situation?
Thanks
Thorsten