class MyClass { // the error disappears by removing the virtual keyword! virtual void myMethod() {}; }; class MyClass { }; int main() { return 0; }