tags:

views:

1696

answers:

4

I was getting the following error compiling and iPhone project. Anybody know how I may fix it? "vtable for oned::MultiFormatUPCEANReader", referenced from: __ZTVN4oned23MultiFormatUPCEANReaderE$non_lazy_ptr in MultiFormatUPCEANReader.o ld: symbol(s) not found collect2: ld returned 1 exit status

+6  A: 

The problem seemed to be that in the class MultiFormatUPCEANReader I had declared a constructor and destructor, but had not written a body for the destructor, this was causing this annoying problem. Hope this helps somebody solve their compile error. This is a terrible compiler error with little information!

Andres
I agree, terrible error message. I had this because no implementation of virtual method in base class.
Nick
+3  A: 

Generically, this is the missing vtable problem: C++ FAQ Lite 23.10.

David Joyner
that saved my life :)
name
A: 

The same error can occur when one forgets to put the class name in front of the definition of a method in the cpp file - like I just did. And it's not an xcode thing, I'm using cmake for building and gcc as compiler (as xcode typically does).

Frank
A: 

Yeah, forgetting to put the class name in the front of a pure virtual function I was overriding was the cause for me.

Q_Q