delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/17/01:01:07

Date: Mon, 16 Mar 1998 17:57:52 -0800 (PST)
Message-Id: <199803170157.RAA24206@adit.ap.net>
Mime-Version: 1.0
To: Gavin Sinclair <gavins AT cse DOT unsw DOT EDU DOT AU>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Run-time error: pure virtual function called

At 11:57  3/16/1998 +1100, Gavin Sinclair wrote:
>Hello,
>
>I'm having this strange problem whereby my program dies at runtime with
>the message "Pure virtual function called" (using DJGPP of course, gcc
>2.7.2.1).  Now I know what it means (it's a C++ program), but I found
>where it was stopping and there are certainly no pure virtual function
>calls.  In fact it seems to dislike the line
>
>	return kingthreats.numElements;
>
>where there are obviously no function calls at all.  Has anyone had any
>experience with this?

I don't know C++ very well, but if I'm correct, when a function returns,
destructors get called for objects local in scope to that function. Can it
be that one of those destructors is causing the problem?

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019