E2353 Class 'classname' is abstract because of 'member = 0' (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

This message is issued immediately after the "Cannot create instance of abstract class 'classname' error message and is intended to make it easier to figure out why a particular class is considered abstract by the compiler.

For example, consider the following example of an illegal attempt to instantiate an abstract class:

struct VB
{
virtualvoid  f() = 0;
virtualvoid  g() = 0;
virtualvoid  h() = 0;
};
struct D1 : virtual VB
{
void   f();
};
struct D2 : virtual VB
{
void   h();
};
struct DD : D1, D2
{
}
v;   // error 'DD' is an abstract class

The above code will cause the following two error messages:

Error TEST.CPP 21 Cannot create instance of abstract class 'DD'
Error TEST.CPP 21 Class 'DD' is abstract because of 'VB::g() = 0'