undefined reference to `vtable for __cxxabiv1::__class_type_
Posted: Wed Apr 12, 2017 7:41 pm
Hello Guys,
I am writing a kernel for like 2 months now and converted the project to C++ but virtual function do not seem to work for me.
I have CPPFLAGS?=-O2 -g -fno-exceptions -fno-rtti and also defined in a .cpp file the extern "C" void __cxa_pure_virtual().
Still getting this:
i686-elf-g++ --sysroot=/home/geri/workspace/bodos/src/../sysroot -isystem=/usr/include -T arch/i386/linker.ld -o bodos.kernel -D__is_kernel -Iinclude -ffreestanding -Wall -Wextra arch/i386/crti.o arch/i386/crtbegin.o arch/i386/boot.o arch/i386/tty.o arch/i386/cursor.o arch/i386/io.o arch/i386/serialport.o arch/i386/gdt.o arch/i386/init.o arch/i386/gdt_load.o arch/i386/isr.o arch/i386/isr_irq.o arch/i386/idt.o arch/i386/interrupt_x86.o arch/i386/irq.o arch/i386/timer.o arch/i386/keyboard.o arch/i386/paging.o arch/i386/sched/ctxswitch.o arch/i386/sched/switch.o kernel/kernel.o kernel/kprintf.o kernel/debug.o kernel/mem/allocator.o kernel/mem/kmalloc.o kernel/utils/random.o kernel/tests/RandomTest.o kernel/tests/TestCenter.o -nostdlib -lk -lgcc arch/i386/crtend.o arch/i386/crtn.o
arch/i386/sched/ctxswitch.o:(.rodata._ZTIN9scheduler3PooE[typeinfo for scheduler::Poo]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
arch/i386/sched/ctxswitch.o:(.rodata._ZTIN9scheduler3FooE[typeinfo for scheduler::Foo]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
collect2: error: ld returned 1 exit status
Makefile:61: recipe for target 'bodos.kernel' failed
Does anyone know how to resolve this or I might be doing wrong?
Thanks a lot!
Greg
I am writing a kernel for like 2 months now and converted the project to C++ but virtual function do not seem to work for me.
I have CPPFLAGS?=-O2 -g -fno-exceptions -fno-rtti and also defined in a .cpp file the extern "C" void __cxa_pure_virtual().
Still getting this:
i686-elf-g++ --sysroot=/home/geri/workspace/bodos/src/../sysroot -isystem=/usr/include -T arch/i386/linker.ld -o bodos.kernel -D__is_kernel -Iinclude -ffreestanding -Wall -Wextra arch/i386/crti.o arch/i386/crtbegin.o arch/i386/boot.o arch/i386/tty.o arch/i386/cursor.o arch/i386/io.o arch/i386/serialport.o arch/i386/gdt.o arch/i386/init.o arch/i386/gdt_load.o arch/i386/isr.o arch/i386/isr_irq.o arch/i386/idt.o arch/i386/interrupt_x86.o arch/i386/irq.o arch/i386/timer.o arch/i386/keyboard.o arch/i386/paging.o arch/i386/sched/ctxswitch.o arch/i386/sched/switch.o kernel/kernel.o kernel/kprintf.o kernel/debug.o kernel/mem/allocator.o kernel/mem/kmalloc.o kernel/utils/random.o kernel/tests/RandomTest.o kernel/tests/TestCenter.o -nostdlib -lk -lgcc arch/i386/crtend.o arch/i386/crtn.o
arch/i386/sched/ctxswitch.o:(.rodata._ZTIN9scheduler3PooE[typeinfo for scheduler::Poo]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
arch/i386/sched/ctxswitch.o:(.rodata._ZTIN9scheduler3FooE[typeinfo for scheduler::Foo]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
collect2: error: ld returned 1 exit status
Makefile:61: recipe for target 'bodos.kernel' failed
Does anyone know how to resolve this or I might be doing wrong?
Thanks a lot!
Greg