Need Help With LNK2005 Error
I have a couple classes inside one of my header files which I need to access in two different .cpp files, so I tried to include the .h file in both. One of the class declarations looks like this:
Code:
class GamePlayers
{
public:
GamePlayers();
void AssignCard(CardTypes Card);
void AssignPosition(PositionTypes Position);
private:
CardTypes Hand[14];
PlayerTypes PlayerID;
PositionTypes Position;
bool Human;
int Score;
} Player1, Player2, Player3, Player4;
Now when I try to compile I get the following linker error for every member of either class:
Quote:
Graphics.obj : error LNK2005: "class GamePlayers Player1" (?Player1@@3VGamePlayers@@A) already defined in Gameplay.obj
What do I need to do to fix this problem?