This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What does "pure virtual method called" error mean?
On Wed, Jan 23, 2002 at 01:24:16PM -0200, Alexandre Oliva wrote:
> On Jan 23, 2002, Abizar <Abizar@stts.com.sg> wrote:
>
> > During run-time, my program terminates and the message "pure virtual method
> > called" is shown.
> > The program was compiled using GCC3.0.3. I would like to know what are its
> > possible causes.
>
> In general, it means you've called a method that is declared pure
> virtual (i.e., virtual with a = 0 ``initializer''). Such a method can
> only be called if you call it from within a constructor or a
> destructor of a base class or if you explicitly tell the compiler to
> call a base class method using the baseclass::method() notation.
I have seen "pure virtual method" called sometimes when
you try to invoke a virtual method on a pointer to class that has
already been deleted. It points to memory management problems
in a user's code.
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net