N
none
I have the following:
class Base {
public:
void test();
};
class Sub : public Base {
public:
};
int main() {
Sub sub;
sub.test();
return 0;
}
which gives this error:
main.cpp.text+0xa): undefined reference to `Base::test()'
collect2: ld returned 1 exit status
make[2]: *** [rus] Error 1
make[1]: *** [CMakeFiles/rus.dir/all] Error 2
make: *** [all] Error 2
Why is it not possible to call the base function test() on the sub instance?
class Base {
public:
void test();
};
class Sub : public Base {
public:
};
int main() {
Sub sub;
sub.test();
return 0;
}
which gives this error:
main.cpp.text+0xa): undefined reference to `Base::test()'
collect2: ld returned 1 exit status
make[2]: *** [rus] Error 1
make[1]: *** [CMakeFiles/rus.dir/all] Error 2
make: *** [all] Error 2
Why is it not possible to call the base function test() on the sub instance?