My problem looks as follows. I've got two classes Unit which is a base class for infantry they're in separate files
infantry.h
unit.hCode:#ifndef JB_INFANTRY_H_INCL #define JB_INFANTRY_H_INCL #include"main.h" #include"Unit.h" class Infantry : public Unit { public: Infantry(); ~Infantry(); UnitType unittype(); void heal(); void fortify(); private: int fortification; }; #endif
problem is that when i'm compiling this i get error in infantry.hCode:#ifndef JB_UNIT_H_INCL #define JB_UNIT_H_INCL #include"main.h" class Unit { public: Unit(); virtual ~Unit(); void SetOwner(OwnerType towhat); void SetHealth(int towhat); void SetActionpoints(int towhat); void SetPosition(int towhat[]); void SetListposition(int towhat); int GetAtt(); int GetDef(); OwnerType GetOwner(); int GetActionpoints(); int GetHealth(); int GetMaxap(); int *GetPosition(); int GetListposition(); UnitType virtual unittype(); void virtual heal(); //void virtual action(int direction); //add attack and move protected: int att,def,actionpoints,listposition,maxap,health,position[2]; OwnerType owner; }; #endif
"11 C:\Dev-Cpp\Projects\KOS\Infantry.h expected class-name before '{' token "
whats wrong ? I can't get it ?



LinkBack URL
About LinkBacks


