Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: Scipi on November 18, 2011, 11:26:27 pm

Title: Help with unreferenced vtables
Post by: Scipi on November 18, 2011, 11:26:27 pm
I'm running into a wall with my code where apparently there are undefined virtual tables for some of my classes.

Here's the code:

http://pastebin.com/zXFgjF9S (http://pastebin.com/zXFgjF9S)

What I am doing is I have an Abstract Base Class, Item. And I have derived classes Medicine, DCD, and BlueLobster. Each place where the constructors and deconstructors are defined I get the error

Quote
undefined reference to `vtable for <Class_Name>'

Can anyone help me with what I'm doing wrong.
Title: Re: Help with unreferenced vtables
Post by: jacobly on November 19, 2011, 03:05:38 am
My initial guess would be that it is because of missing function implementations:
specifically void Medicine::Effect() { } and void DCD::Effect() { } and void BlueLobster::Effect() { }.

Edit:
Quote
If you get a link error of the form "Error: Unresolved or undefined symbols detected: virtual table for class Fred," you probably have an undefined virtual member function in class Fred.
So that's probably it.
Title: Re: Help with unreferenced vtables
Post by: Scipi on November 19, 2011, 10:32:21 am
Yeah, I figured that out last night and that was it. Thanks anyways :D