What does 'error: base class has incomplete type' mean in c++?

Example:

class Base;

class Derived : public Base {
    // ...
};

The error arises when trying to inherit from a forward-declared but not yet defined class.

Solution:

Define the base class before the derived class.


class Base {
    // ...
};

class Derived : public Base {
    // ...
};

Beginner's Guide to C++