I am referencing 2 classes with themselves using forward referencing however I am still getting errors with my class instance declarations in each class. Note: I'm using DirectX and version control if that has anything to do with it?
Game.h:
#ifndef GAME_H
#define GAME_H
class Player;
class Game {
public:
Player player; // Undefined class error here
//...
};
#endif
Player.h:
#ifndef PLAYER_H
#define PLAYER_H
class Game;
class Player {
public:
Game game; // Undefined class error here
//...
};
#endif
Obviously there is a lot more code but I thought including only essential code would make it easier for you to read.
Any help would be greatly appreciated.
Many thanks
Ash