From: G DOT DegliEsposti AT ads DOT it To: djgpp AT delorie DOT com Message-ID: Date: Wed, 18 Mar 1998 17:48:11 +0100 Subject: Re: Run-time error: pure virtual function called Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Precedence: bulk >> > the message "Pure virtual function called" (using DJGPP of course, gcc >> > 2.7.2.1). >> >> The most obvious way how to get this message is to call virtual function >> from constructor or destructor of base class when this virtual function is >> redefined in inheritted class > >Why is this a runtime error? Can't the compiler locate this bug? No it can't because when it is compiling the function call, the compiler can't know if the pure virtual function will be overridden in some descendent class. You can think like if it was a call to a function pointed by some pointer, how could you know at compile time if at runtime it will be NULL or point to a valid function? (C++ purists forgive me for this example :-) ciao Giacomo