Re: Odd error with g++




"elitecodex" <elitecodex@xxxxxxxxx> wrote in message
news:1137871047.763997.136900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> Fixed it.
>
> I did a little bit more research and just tried something... and it
> worked. I just added virtual to my deconstructor.
>
> Any ideas as to why that would fix it? What does the deconstructor
> being virtual have to do with a method of being virtual?
>
> Thanks for your help

G++ needs to create one and only one copy of the vtable for the class.
If you give it no way to find one place to do that, then it will choke. I
believe G++'s heuristic is to create the vtable in whatever code file
implements the first virtual function. By making the destructor virtual and
implementing it, you make that heuristic work.

DS


.