fork(1) download
  1. #include <string>
  2.  
  3. class Animal
  4. {
  5. public:
  6. virtual ~Animal() = 0;
  7.  
  8. std::string _name;
  9. };
  10.  
  11. class Dog : public Animal
  12. {
  13. };
  14.  
  15. int main() {
  16. Animal* pet = new Dog;
  17. delete pet;
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/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
stdout
Standard output is empty