开发者

Why am I getting Multiple Types in One Declaration?

开发者 https://www.devze.com 2023-03-30 06:37 出处:网络
Here is my class: #include <iostream> #include \"gameobject.h\" #include \"IXmlAssigner.h\" #ifndef CHARACTER_H

Here is my class:

#include <iostream>
#include "gameobject.h"
#include "IXmlAssigner.h"

#ifndef CHARACTER_H
#define CHARACTER_H
//line 7...
enum Race {HUMAN, DARK_ELF};
enum Gender {MALE, FEMALE};

class Character : public GameEntity, protected IXmlAssigner
{
public:
    Character();
    Character(std::string xmlCharID);
    ~Character();

    int get_id();
    std::string get_name();
    Race get_race();
开发者_运维问答    Gender get_gender();

    virtual void assign_xml(std::string xmlCharID);

protected:
    int char_id;
    static int char_count;
    std::string name;
    Race race;
    Gender gender;
};

#endif // CHARACTER_H

On line 7, it states the "multiple types in one declaration" error. Why is this? Is there anything I can do to change it?


#include "gameobject.h"
#include "IXmlAssigner.h"

Most likely you're missing a ; at the end of a class or structure declaration at the end of one of these headers.

0

精彩评论

暂无评论...
验证码 换一张
取 消