Getting linking error: not found in vtable (Trying to understand whats wrong the way I did my classe

G

g35rider

Hi,
I am trying to understand from C++ point of view what the problem
is.

I have a file called.

Controllers.h in which I have a base class Controller and couple of
other sub classes AController and BController. Now I have given the
implementation of Controller constructor in Controller.h, but have
written 2 seperate cpp files for AController and BController. Now I
make a library out of the 2 cpp files called libController.a

I have a apps directory where I use AController and BController without
instansiating Controller anywhere, but when I compile, its ok, but when
I link with libController.a I get that linking error for undefined
vtable reference to Controller?

Should I made the Controller also in another cpp file, but I dont have
much code in it, its only a line, so thought it would be ok to put it
in the header file.

Thanks
Ankur
 
V

Victor Bazarov

[..] Now I
make a library out of the 2 cpp files called libController.a

[..] when I link with libController.a I get that linking error for
undefined vtable reference to Controller?

This is beyond the scope of this newsgroup, unfortunately. We discuss
the language, and the language does not define libraries or linking
with them. You need to ask in the newsgroup that deals with your OS
or your compiler.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top