I have the following classes, Base and Derived and when I compile the compiler complains that it cannot create an instance of DLog because it is abstract.
Can someone te
By deriving your DLog
class from Logger
you are assuring that you will provide the implementation for all (assuming you don't want DLog
as an abstract class) pure virtual methods declared in the base class. Here you have not provided implementation to pure virtual functions hence class DLog
becomes an abstract class. In C++ you can not create an instance of an abstract class hence you get the compiler error. BTW, your base class is missing the virtual destructor.