Welcome! Log In Create A New Profile


Undefined reference to vtable

Posted by diego_pmc 
Undefined reference to vtable
May 09, 2010 12:10PM
Hi, I'm having an odd linker error that I don't know how to solve. It is telling me that there is an undefined reference to the vtable for EndState() and ~EndState() constructor and destructor. I've looked around the web and it seems this kind of error is related to classes inheriting from pure virtual classes (EnState inherits from GameState, which is pure virtual).
Here's my project files (includes VS10 and PN projects):
> [www.mediafire.com]

Does anyone know how I can fix this?

EndState header: include\game_state\end_state.h
EndState source: source\game_state\end_state.cpp

GameState abstract class header: include\game_state\game_state.h
GameState abstract class source: (no source)

Edited 4 time(s). Last edit at 05/09/2010 12:47PM by diego_pmc.
Re: Undefined reference to vtable
May 09, 2010 04:20PM
In end_state.cpp,

void onOpen() {}
void onClose() {}
void EndState::onOpen() {}
void EndState::onClose() {}

See if that makes any difference.

Re: Undefined reference to vtable
May 09, 2010 05:23PM
That solved it, thanks a million. (Silly mistake.)
Sorry, only registered users may post in this forum.

Click here to login