Re: Odd error with g++
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: Sat, 21 Jan 2006 23:45:42 -0800
"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
.
- Follow-Ups:
- Re: Odd error with g++
- From: Roger Leigh
- Re: Odd error with g++
- References:
- Odd error with g++
- From: elitecodex
- Re: Odd error with g++
- From: David W Noon
- Re: Odd error with g++
- From: elitecodex
- Re: Odd error with g++
- From: elitecodex
- Odd error with g++
- Prev by Date: Re: Odd error with g++
- Next by Date: Re: Odd error with g++
- Previous by thread: Re: Odd error with g++
- Next by thread: Re: Odd error with g++
- Index(es):