fork(4) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Base
  5. {
  6. virtual void method() = 0;
  7. };
  8.  
  9. struct Derived : Base
  10. {
  11. void method() { Base::method(); };
  12. };
  13.  
  14. int main()
  15. {
  16. Derived d;
  17. d.method();
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/DlKfAP/ccsWfQ3T.o: In function `main':
prog.cpp:(.text.startup+0x49): undefined reference to `Base::method()'
/home/DlKfAP/ccsWfQ3T.o: In function `Derived::method()':
prog.cpp:(.text._ZN7Derived6methodEv[_ZN7Derived6methodEv]+0x1): undefined reference to `Base::method()'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty