小编riv*_*von的帖子

无效使用不完整类型/转发声明

我试着看看Stackoverflow和谷歌上列出的类似问题,但他们主要处理模板,这不是我的情况.我在Debian测试64位上使用GCC 4.4.5.
所以,我有两个类 - CEntity:

#ifndef CENTITY_H_INCLUDED
#define CENTITY_H_INCLUDED

#include "global_includes.h"

// game
#include "CAnimation.h"
#include "Vars.h"
#include "vector2f.h"
#include "Utils.h"

class CAnimation;

class CEntity
{
public:
    CEntity();
    virtual ~CEntity();

    void _update(Uint32 dt);

    void updateAnimation(Uint32 dt);

    void addAnimation(const std::string& name, CAnimation* anim);
    void addAnimation(const std::string& name, const CAnimation& anim);
    void removeAnimation(const std::string& name);
    void clearAnimations();

    bool setAnimation(const std::string& name);

    SDL_Surface* getImage() const;

    const vector2f& getPos() const;
    const vector2f& getLastPos() const;
    F getX() const;
    F getY() const;
    F getLastX() const;
    F …
Run Code Online (Sandbox Code Playgroud)

c++ gcc forward-declaration incomplete-type

15
推荐指数
3
解决办法
4万
查看次数

标签 统计

c++ ×1

forward-declaration ×1

gcc ×1

incomplete-type ×1