Jump to content
  • Advertisement
Sign in to follow this  
JPulham

linker error : vtable

This topic is 4553 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
Advertisement
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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!