gpt4 book ai didi

gcc - "multiple types in one declaration"但没有;丢失的

转载 作者:行者123 更新时间:2023-12-04 22:08:27 28 4
gpt4 key购买 nike

我尝试使用 Code::Blocks(gcc 编译器)编译我的程序。我得到一个错误:这是它提示的源文件:

#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 行“一个声明中的多种类型”,这让我发疯。我在谷歌上搜索了很多,但常见的解决方案是“找到丢失的分号”。问题是根本没有丢失分号。它总是指向第 16 行(至少在 protected 之后),即使有评论甚至超出了 eof(当我删除所有字段使文件变小时)。

(这个问题可能是微不足道的,我现在可能很累,所以我必须睡一觉。我希望明天早上之前有人能给我一些建议。)

最佳答案

您是否有一个名为 Status 的类或其他一些 UDT?如果将成员的名称更改为 Status_ 会怎样?

关于gcc - "multiple types in one declaration"但没有;丢失的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/600707/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com