I have just seen similar question but that doesn't solve my problem, because I'm struggling with inheritance. That's how my simplified code looks:
Game.h
#include "Ghost.h"
class Game
{
Ghost * myGhost;
};
Ghost.h
#include "MovableItem.h"
class Ghost : public MovableItem
{
Ghost(Game * parentGame) : MovableItem(parentGame)
{
}
};
MovableItem.h
class MovableItem
{
MovableItem(Game * parentGame);
};
When I'm trying to use forward declaration of class Game, I get 'invalid use of incomplete type class Game' compilation error and without that declaration I get 'Game does not name a type'. How can I solve that problem? Thanks for advance.