I have two classes, base class A and derived class B. Definition as below:
Class A {
public:
A()
{
ImpleDefinition();
}
~A()=default:
protected:
virtual void ImplDefinition()=0;
}
class B : public A
{
public:
B() : A()
{
}
~B()=default;
private:
void ImplDefinition() override
{
/*Some detailed implementation*/
}
}
So when compiling this code, compiler reports "error LNK2001: unresolved external symbol" error. From code itself, I can't see I made any mistake. Interesting, if I change "ImplDefinition" from pure virtual function to virtual function.
void ImplDefinition() {};
Then everything works fine. How to explain this situation?