Page 1 of 1

help,c++ kernel link error

Posted: Sun Jul 29, 2007 8:39 pm
by aninggo
i I download Quark-0.1 http://sarovar.org/projects/quark
i try make the kernel(in FC6,G++ 4.0.1)
but show link error

ld --oformat=binary -N -emain -Ttext 0x7400 -o kernel.bin main.o GDT.o IDT.o Exceptions.o PIC.o PIT.o PortIO.o Bios.o VGA.o Console.o Debug.o Keyboard.o Speaker.o Shutdown.o Delay.o DeviceQueue.o Shell.o Time.o exception.o DMA.o ../lib/libc.o
PIT.o: In function `initTimeArea()':
PIT.cpp:(.text+0x34): undefined reference to `memcpy'

Posted: Mon Jul 30, 2007 1:25 am
by JamesM
Did all the files compile correctly? If one didn't (containing memcpy) the symbols in it won't be generated, and you'll get that error.
Alternatively check all files are included in the linker command.

Posted: Mon Jul 30, 2007 1:52 am
by pcmattman
'memcpy' must be defined as extern "C".

Posted: Mon Jul 30, 2007 2:01 am
by aninggo
ok, make success, thanks JamesM and pcmattman. :)