Code :: Blocks (gcc 컴파일러)를 사용하여 프로그램을 컴파일하려고했습니다. 그리고 오류가 발생합니다 :"하나의 선언에 여러 유형이 있지만"아니오; missing
#ifndef BOT_H
#define BOT_H
#include "player.h"
#include "timer.h"
class BOTS; // forward decalaration of BOTS
class BOT : public PLAYER
{
public:
enum BotStatus{BotMoving,BotPursue,BotChasePowerup};
enum BotMovDir{Up,Down,Left,Right,Forward,Backward};
enum BotSkill{Easy,Normal,Hard,Expert,Insane};
protected:
BotStatus Status; // this is the line it complaining about
BotMovDir CurrentMov;
TIMER CTimer;
bool Stucked;
BotSkill Skill;
VECTOR3D AimTarget;
// VECTOR3D ShotTarget;
PLAYER *PursueObj;
bool SameLevel;
BOTS *Owner;
bool PlayerHitMe;
void OnDamage(double dmg,const wchar_t *Shooter,bool s);
void OnReset();
public:
BOT(BOTS *o,const wchar_t *botname) : PLAYER(botname), PlayerHitMe(false), Status(BotMoving), Skill(Easy), Owner(o)
{
PlayerInit();
}
void SetSkill(BotSkill bs) {Skill=bs;}
void BotControl();
void SetSameLevel(bool s) {SameLevel=s;}
virtual ~BOT() {}
};
#endif
그것은 "한 선언에서 여러 유형"16 라인에 대해 불평하고 나를 미치게 운전 : 여기에 대해 불평 소스 파일입니다. 나는 많이 봤지만 일반적인 해결책은 "누락 된 세미콜론 찾기"입니다. 그리고 문제는 세미콜론이 전혀 없다는 것입니다. 주석이 있거나 심지어는 eof (파일이 작아 지도록 모든 필드를 제거 할 때) 이상인 경우에도 항상 16 행을 가리 킵니다 (최소한 보호 된 후에).
(이 문제는 사소한 수 있으며 지금은 피곤 될 수있다, 그래서 잠을해야합니다. 그리고 나는 누군가가 나에게 아침 내일까지 조언을 준 바랍니다.)
필드를 주석 처리 할 때 다음 줄에 대해 불평을 시작합니다. – Calmarius