I have a class A with virtual inline getters and setters. From A there are two classes B and C derived. And I have a class D, derived from B and C. Creatung an object from D and using the getName() results in "undefined reference to getName()". Removing "inline" doens't work. The header file is included correctly. What's the problem here?
class A
{
public:
virtual inline std::string getName() const{return name;}
protected:
std::string name;
};
class B : public virtual A {};
class C : public virtual A {};
class D : public B, public C {};