J
jimjim
Hello all,
class Base {
public:
virtual void f(); };
class Derived : public Base{
private:
int i; };
int main() {
Derived arrayOfDerived[10]; }
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccwM5eGM.o(.rdata$_ZTV7Derived[vtabl
e for Derived]+0x8):wrong.cpp: undefined reference to `Base::f()'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccwM5eGM.o(.text$_ZN4BaseC2Ev[Base::
Base[not-in-charge]()]+0x8):wrong.cpp: undefined reference to `vtable for
Base'
collect2: ld returned 1 exit status
Why doesnt this piece of code compile?
TIA
class Base {
public:
virtual void f(); };
class Derived : public Base{
private:
int i; };
int main() {
Derived arrayOfDerived[10]; }
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccwM5eGM.o(.rdata$_ZTV7Derived[vtabl
e for Derived]+0x8):wrong.cpp: undefined reference to `Base::f()'
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccwM5eGM.o(.text$_ZN4BaseC2Ev[Base::
Base[not-in-charge]()]+0x8):wrong.cpp: undefined reference to `vtable for
Base'
collect2: ld returned 1 exit status
Why doesnt this piece of code compile?
TIA