On 03/03/2006, seema wrote:
I am new to C++ programming. Can some body explain reason for this
compilation error,
../inc/polecache.h", line 339: error #2322: object of abstract class
type
"CPoleCache::CCacheViewImpl" is not allowed:
pure virtual function "IViewObject::Draw" has no overrider
CCacheViewImpl m_View;
/\
In C++ an abstract class has at least one pure virtual function.
A pure virtual function is a function which is declared in its class
with the suffix "=0". This means that the function is not defined in
its class.
So an abstract class can't be used on its own to create an object. You
have to provide a derived class where all the pure virtual functions
are defined.
The error message is saying that you've tried to create an object of
abstract class type "CPoleCache::CCacheViewImpl", perhaps by creating
the object on the heap with "new", or creating the object on the stack
with
CPoleCache::CCacheViewImpl foo;
If you're new to C++, you definitely need this:
http://www.parashift.com/c++-faq-lite/
--
Simon Elliott
http://www.ctsn.co.uk