class PLAYER
{
private:
char name[32];
int strength;
int intelligence;
int gold;
int experience;
int health;
int maxhealth;
int mana;
int maxmana;
int level;
public:
void SetName(char* newname);
char* GetName();
void SetStrength(int newstr);
int GetStrength();
void SetIntelligence(int newint);
int GetIntelligence();
void SetGold(int newgold);
void AddGold(int amount);
int GetGold();
void SetExperience(int newexperience);
void AddExperience(int amount);
int GetExperience();
void SetHealth(int newhealth);
void AddHealth(int amount);
void LoseHealth(int amount);
int GetHealth();
void SetMaxHealth(int newmaxhealth);
int GetMaxHealth();
void SetMana(int newmana);
void AddMana(int amount);
void LoseMana(int amount);
int GetMana();
void SetMaxMana(int newmaxmana);
int GetMaxMana();
};
here are the errors:
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(5) : error C2653: 'PLAYER' : is not a class or namespace name
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(7) : error C2065: 'experience' : undeclared identifier
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(7) : error C3861: 'SetExperience': identifier not found
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(10) : error C2653: 'PLAYER' : is not a class or namespace name
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(12) : error C2065: 'gold' : undeclared identifier
1>c:\documents and settings\timbo\my documents\visual studio 2008\projects\game\game\player.cpp(12) : error C3861: 'SetGold': identifier not found
1>Town.cpp
(or you can do it as an in-line function in player.h as it is a small function)
The same for theSetGold function (and all the other remaining functions you have declared in the player class - they all need bodies before you can use them -or you will get the linker errors.)
I inferred that was the problem in my first response. It was never confirmed by the original poster, but I assumed that was the problem since the poster never said otherwise.