I have gotten fatal error "c2011" and can't seem to fix it.
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>f:\jesse's stuff\holder\my\documents\project folder\new folder\game\game\weaponc.h(2) : error C2011: 'Weapon' : 'class' type redefinition
1> f:\jesse's stuff\holder\my\documents\project folder\new folder\game\game\weaponc.h(2) : see declaration of 'Weapon'
1>f:\jesse's stuff\holder\my\documents\project folder\new folder\game\game\charaterc.h(2) : error C2011: 'Charater' : 'class' type redefinition
1> f:\jesse's stuff\holder\my\documents\project folder\new folder\game\game\charaterc.h(2) : see declaration of 'Charater'
1>f:\jesse's stuff\holder\my\documents\project folder\new folder\game\game\fighter.h(1) : fatal error C1014: too many include files : depth = 1024
1>Build log was saved at "file://f:\Jesse's Stuff\Holder\My\Documents\Project Folder\New Folder\Game\Game\Debug\BuildLog.htm"
1>Game - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
// WeaponC
class Weapon
{
public:
int Spd;
int Damage;
int Def;
int Accu;
bool Use;
};
//CharaterC
class Charater
{
public:
int MaxHealth;
int Str;
int Con;
int Dex;
int MP;
int Int;
int Wis;
int Ini;
int XP;
int Level;
char Name;
int Health;
int HealthIncrease(int x)
{
MaxHealth = MaxHealth + x;
return Health;
}
int StrengthIncrease(int x)
{
Str = Str + x;
return Str;
}
int ConIncrease(int x)
{
Con = Con + x;
return Con;
}
int getLv()
{
return Level;
}
int getCon()
{
return Con;
}
void getIni()
{
Dex;
}
};
//Fighter
#include "include.h"
Charater Fighter;
void F()
{
Fighter.MaxHealth = 250;
Fighter.MP = 10;
Fighter.Str = 110;
Fighter.Con = 120;
Fighter.Dex = 80;
Fighter.Int = 50;
Fighter.Wis = 45;
Fighter.Name = 'Figh';
Fighter.Level = 1;
return;
}
any Ideas are welcome please help
Check for cycles in your inclusion graph. That is, make sure that if A includes B and B includes C, C includes neither B nor A, nor B includes A.