#include <string> class Animal { public: virtual ~Animal() = 0; std::string _name; }; class Dog : public Animal { }; int main() { Animal* pet = new Dog; delete pet; return 0; }
Standard input is empty
/home/abDVbj/cc8ghrZk.o: In function `Dog::~Dog()': prog.cpp:(.text._ZN3DogD2Ev[_ZN3DogD5Ev]+0xb): undefined reference to `Animal::~Animal()' /home/abDVbj/cc8ghrZk.o: In function `Dog::~Dog()': prog.cpp:(.text._ZN3DogD0Ev[_ZN3DogD0Ev]+0x12): undefined reference to `Animal::~Animal()' collect2: error: ld returned 1 exit status
Standard output is empty