I was making a text based game in the console.
I designed a class named
Player in a file
Player.h
and a class named
Moves in another file named
Moves.h
Both are included in side the other (
Player.h in
Moves.h and vice-versa)
I did this because I needed some functions to retrieve data from the other class.
Like to see if the Player has energy to do the specific move in the move class, I did it like this:
bool Move(Player&);
And similarly the
Player will have a set of
Moves allocated to it, so the
Player class has an object of type
Moves.
But on compilation, I get the following errors:
fighters.h(16): error C2065: 'Moves' : undeclared identifier
moves.h(21): error C2061: syntax error : identifier 'Player'
The Lines where they have been used:
Move.h
Player.h
Now I have checked that both the files have been included already.
Can any one Help me find the problem?
I can't see any reason for these errors to appear at all.