pure virtual method called

Darbin Rowland-p56553 Rowland.Darbin@gdds.com
Wed Feb 16 11:04:00 GMT 2005

I am getting a "pure virtual method called" error followed by a nicely printed "Abort" in my application. I have looked and seen this as a problem for static casted objects but mine aren't. Has anyone else seen this behavior before. 

To repeat this error all I have to do is leave the interference method which internally calls "delete this" when the reference count is 0 (which it is, nobody else knows about it any more). The method causes this error on the return not on the "delete this" but commenting out the delete line prevents the problem from occurring. I wrote a test application which does a similar thing but it doesn't produce the problem, so I am at a loss. Any insight would be greatly appreciated.

Incidentally this code is in a shared library, and also it compiles and runs as expected on windows when built with VC6.0.

 - Rowland

More information about the Gcc-help mailing list