I have to make a Chain of Mountains that contains other chains or simple mountains. For that reason I constructed a Class Mountain and then two sub-class. The subclass Chain and the subclass MountainSingle. The class chain contains itself a vector of pointers to other objects of type Mountain(Thus I have a vector containing pointers to other MountainSingle or Chain). My code is the following:
CLASS CHAIN
Chain* Chain::copie() const {
return (new Chain(*this));
}
But upon compilation I get the following error. I know that there are many other posts about the issue but even if I made the small adjustements proposed I still get the following error
Chain::Chain(Chain const & ): undefined reference to vtable for chain.