且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C++ - “未声明成员函数"在派生类中

更新时间:2022-12-25 10:27:17

在 PlayerSpriteKasua.h 中,您需要重新声明要覆盖/实现的任何方法(没有=0"表示这些方法是不再抽象).所以你需要这样写:

In PlayerSpriteKasua.h you need to re-declare whatever methods you're going to override/implement (without the "=0" to say that those methods are not abstract anymore). So you need to write it like follows:

class PlayerSpriteKasua : public PlayerSpriteBase
{
public:
    virtual void think();
    virtual void render(long long ScreenX, long long ScreenY);
    virtual int getHealth();
};

...或者您是否省略了它以缩短您的帖子?

...or did you omit that to keep your post shorter?