Because your Der
is not derived from Base
. Your classes are unrelated. There's no inheritance relationship between them.
If you indeed define your Der
as a descendant of Base
class Der : public Base
{
...
the code will compile.
The compiler cannot magically guess that you wanted to derive your Der
from Base
. You are supposed to remember to explicitly tell the compiler about it.