placeable.h
#include "selectable.h" class placeable : selectable { .. };
selectable.h
#include "game.h" class selectable { .. };
game.h
#include "placeable.h" class game { ... class placeable* holding; ... };
Basically placeable.h includes selectable.h, which includes game.h, which includes placeable.h again.
The only solution I can think of is to place the placed * in a new header, which makes it static / global, and then include this new header in game.h and selectable.h.
I'm sorry that I did not include the header blocks in the top code. I assumed this was obvious. The header protector does not help in this case due to inheritance, the same thing happens with the forward declaration.
source share