#include <iostream>
using namespace std;
class Base
{
public:
Base() {};
~Base() {};
virtual void stuff1();
virtual void stuff2();
};
void Base::stuff1()
{
stuff2();
}
class Derived : public Base
{
public:
Derived() {};
~Derived() {};
void stuff2();
};
void Derived::stuff2()
{
cout<<"asdasd"<<endl;
return;
}
int main()
{
Derived d;
d.stuff1();
return 0;
}
the code should be something like this. i think..
and compiling this gives me a linker error about undefined Base::stuff2()
/tmp/ccBAAYa4.o

.rodata._ZTV4Base[vtable for Base]+0x18): undefined reference to `Base::stuff2()'
if i implement Base::stuff2() witch does nothing, it works as needed