Guest
#1171319
Hi:)
I would like to use virtual functions. I wrote simple test program:
/***********************************************************************
***/
#include "lpc2000.h"
class A {
public:
void virtual fun1(){
GPIO_IOCLR |= (1<<21) ;
}
};
class B : public A{
public:
void fun1(){
GPIO_IOCLR |= (1<<20);
}
void fun3(){
GPIO_IOCLR |= (1<<18);
}
};
//new object
B sth ;
int main(){
//main loop
while(1){;}
}
/***********************************************************************
***/
but compliler returns error:
"C:\DOCUME~1\kuba\USTAWI~1\Temp/ccUDbaaa.o:(.rodata._ZTI1B[typeinfo for
B]+0x0): undefined reference to `vtable for
__cxxabiv1::__si_class_type_info'
C:\DOCUME~1\kuba\USTAWI~1\Temp/ccUDbaaa.o:(.rodata._ZTI1A[typeinfo for
A]+0x0): undefined reference to `vtable for
__cxxabiv1::__class_type_info'
collect2: ld returned 1 exit status
make.exe: *** [main.elf] Error 1"
What is going on or what is wrong ?