vendredi 20 août 2021

'Undefined Reference to `vtable...' but virtual destructor present [duplicate]

I'm currently working on an implementation for a game engine. I have a Scene class and a subclass of the Scene class called MainGame. I got the error in the title, so I googled it and added a virtual destructor to both classes, as google told me to. But I still keep getting the same error. Any help would be appreciated :)

Console Output

Scene.h

class Scene
    {
    public:
        Scene(const std::string& sceneName);

        virtual ~Scene() { }

        virtual void Initialise();
        virtual void Update();
        virtual void CloseDown();

    public:
        std::string m_SceneName;
    };

Scene.cpp

    Scene::Scene(const std::string& sceneName)
    {
        m_SceneName = sceneName;
    }

MainGame.h

class MainGame : public Engine::Scene
    {
    public:
        MainGame() : Scene("Main Game Scene") {}

        virtual ~MainGame() { }

        void Initialise() override;
        void Update() override;
        void CloseDown() override;
    };
void MainGame::Initialise()
    {

    }

    void MainGame::Update()
    {

    }

    void MainGame::CloseDown()
    {

    }

Aucun commentaire:

Enregistrer un commentaire