Hi there!
I'm following Bran's Kernel Tutorial to develop my very firsti OS.
I just reached the IDT chapter and I'm stuck with an error I'm getting from the linker.
The error message is:
start.o:start.o:(.text+0x53): undefined reference to `_idtp'
main.o:main.c:(.text+0x14f): undefined reference to `_idt_install'
The tutorial I'm following can be found at:
http://www.osdever.net/bkerndev/index.php?the_id=90
PLEASE NOTE that I'm receiving these errors even if I try to compile the tutorial's code itself!
Please someone help to solve this problem. I really can't find a way to do that.
I'm looking forward to receive (good) news (soon)
Andrea
Linker error - please help!
-
- Posts: 3
- Joined: Thu Dec 07, 2006 2:57 am
- Location: Alassio (Italiy)
- Contact:
Linker error - please help!
Many things have to be seen to be believed.
Other things have to be believed to be seen.
Other things have to be believed to be seen.
I'm guessing you're compiling to ELF format. If so, C functions don't get a leading underscore when accessed from assembly.
The solution is to either remove them from your assembly file or pass '-fleading-underscore' to GCC when compiling the C files.
If you remove them and later want to compile to an object format that does use leading underscores, either pass '-fno-leading-underscore' to GCC or '--prefix _' to NASM.
The solution is to either remove them from your assembly file or pass '-fleading-underscore' to GCC when compiling the C files.
If you remove them and later want to compile to an object format that does use leading underscores, either pass '-fno-leading-underscore' to GCC or '--prefix _' to NASM.
Strange - I downloaded the code at the end of the tutorial, and it seemed to compile and link fine (although there were a few compiler warnings about certain code - but nothing to worry about).I'm receiving these errors even if I try to compile the tutorial's code itself
Do you have a script/bat file that compiles and links everything? If so it would help for you to post that (it sounds as though you've forgotten to link in the idt code). If not, could you post the commands you use to build it?
-
- Posts: 3
- Joined: Thu Dec 07, 2006 2:57 am
- Location: Alassio (Italiy)
- Contact:
solved!
Thanks. I solved the problem and was my mistake.
I forgot to link the idt.o file.
Was getting mad about this problem...now feeling stupid
Thanks a lot guys, keep up the good work!
Andrea
I forgot to link the idt.o file.
Was getting mad about this problem...now feeling stupid
Thanks a lot guys, keep up the good work!
Andrea
Many things have to be seen to be believed.
Other things have to be believed to be seen.
Other things have to be believed to be seen.
Re: solved!
That's also a possibility...spookyrufus wrote:Thanks. I solved the problem and was my mistake.
I forgot to link the idt.o file.
I was wondering why you hadn't run in to this sooner .