Sign in to follow this  

linker error : vtable

This topic is 4304 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a game engine with a base calss called 'FVideoDriver'. When I inherit from that with 'FOpenGLDriver' I get the error: [linker error] undefined reference to 'vtable for Namespace::class'. this happens whenever I try to use inheritance... so whats the problem? I'm using DevCpp with MinGW. (if you need more code tell me)

Share this post


Link to post
Share on other sites
GCC (the compiler used by MinGW) will emit the vtable (virtual function lookup table) into the object file corresponding to the translation unit containing the destructor of the object (got that?).

Try declaring a virtual non-inline destructor in your base class and make sure it's defined in a separate source file that gets included in your app. It can be pure virtual, as long as it's defined somewhere non-inline.

Share this post


Link to post
Share on other sites
Sign in to follow this