Hello people,
I am currently testing my workspace. I have successfully built my cross compiler, but when I try to compile the 'echokernel' from the Raspberry Pi C tutorial I am receiving some errors. The compilers tells me that the uart_init(), uart_puts(hello) and uart_puts(halting) are undefined references. I can't understand why I am receiving the errors I tested it a time with all the code from that page.
I did put the corresponding C and H files into the include folder. I still do not know why I am getting this error because I am sure I have everything good.
- Martin
Raspberry Pi C Tutorial - Compilation gives errors
Re: Raspberry Pi C Tutorial - Compilation gives errors
Please don't use screenshots. Make a textual copy of all the commands you used and the output.
I'll dare guess you simply forgot to link with uart.o (made from uart.c). I assume this should be obvious to those skilled with C and GCC.
Beware, I haven't read that tutorial closely, but it looks like it could use some clean up and be more consistent with other bare bones tutorials.
I'll dare guess you simply forgot to link with uart.o (made from uart.c). I assume this should be obvious to those skilled with C and GCC.
Beware, I haven't read that tutorial closely, but it looks like it could use some clean up and be more consistent with other bare bones tutorials.
Re: Raspberry Pi C Tutorial - Compilation gives errors
Thanks for the tip about the terminal output.
The tutorial needs some cleanup indeed. I found a fault in the Makefile.
I will take a look at the point why I (maybe) not be linking the files in my include-directory.
Edit: I have compiled it again, and I have not spotted any .o files in the include folder. I have succeeded in adding the folder (and its contents) to the objs variable. But now make gives me a error that it there is no make target 'include/mmio.o'.
The tutorial needs some cleanup indeed. I found a fault in the Makefile.
I will take a look at the point why I (maybe) not be linking the files in my include-directory.
Edit: I have compiled it again, and I have not spotted any .o files in the include folder. I have succeeded in adding the folder (and its contents) to the objs variable. But now make gives me a error that it there is no make target 'include/mmio.o'.
Re: Raspberry Pi C Tutorial - Compilation gives errors
I recommend you learn C. Headers are included, not compiled on their own. Get used to user space normal C programming, then try osdev again when you get accustomed to that.
I recommend you throw away the Makefile and just use raw shell commands to compile. When that works, I recommend you learn Make and write your own Makefile.
I recommend you throw away the Makefile and just use raw shell commands to compile. When that works, I recommend you learn Make and write your own Makefile.
-
- Member
- Posts: 307
- Joined: Wed Oct 30, 2013 1:57 pm
- Libera.chat IRC: no92
- Location: Germany
- Contact:
Re: Raspberry Pi C Tutorial - Compilation gives errors
Once again, read the wiki closely before asking stupid questions here (I don't want to sound harsh, but you have to know userspace C very well to be able to start OSdeving). See Beginner_Mistakes and Required_Knowledge