I know that this question has been asked several times, but I do not know how to solve it.
I get this error when I try to build my project:
error LNK2019: unresolved external symbol "public: virtual __thiscall IGameState::~IGameState(void)" ( ??1IGameState@ @ UAE@XZ ) in function "public: virtual __thiscall MenuState::~MenuState(void)" ( ??1MenuState@ @ UAE@XZ )
Here is my code:
IGameState.h
class IGameState { public: virtual ~IGameState(); virtual void update() = 0; virtual void render() = 0; };
MenuState.h
#include "IGameState.h" class MenuState : public IGameState { public: MenuState(); ~MenuState(); void update(); void render(); };
MenuState.cpp
#include "MenuState.h" #pragma region Constructor MenuState::MenuState() { } MenuState::~MenuState() { } #pragma endregion void MenuState::render() { } void MenuState::update() { }
What happened to the destructor? Thanks.
source share