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

标签 gcc types

我尝试使用 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/

相关文章:

c - 如何处理 C 中的多级包含?

在堆栈中创建大内存

java - 为什么 Java multi-catch 不能处理通过子类关联的类型?

c# - 如何在 C# 中调用动态类型的泛型方法

C# 获取给定 T 的类型 Generic<T>

c++ - 抑制从类型 'A' 到类型 'B' 的 g++ 警告强制转换消除常量

python - mac 上的 gcc-4.0 和 xcode 4 已经安装

c++ - 如何为我的编译器告知默认的 C++ 版本(没有显式标志)?

python - Flask-SQLAlchemy 数据类型

python - 如何检查对象的类型为 'dict_items' ?