When typeid(animal).name() returns the base class name and not the actually instantiated type then the base class is not polymorphic (i.e. in common has no virtual destructor), which would be the solution.
typeid(animal).name()