Errors while compiling Bran's Kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Dhaann
Posts: 19
Joined: Fri Dec 19, 2008 1:37 pm

Errors while compiling Bran's Kernel

Post by Dhaann »

Hello everyone,
I've the followed this tutorial, but when compiling, I got errors:

main.c:49: warning: return type of 'main' is not 'int'
main.c: In function 'main':
main.c:63: warning: pointer targets in passing argument 1 of 'puts' differ in signedness
main.c:51: warning: unused variable 'i'
scrn.c: In function 'puts':
scrn.c:14: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
c:/djgpp/bin/ld.exe: scrn.o: No such file: No such file or directory (ENOENT)

What can I do? Last one is logic, because there were errors in scrn.c. But what about the others?

I use djgpp and nasm 2.05
Last edited by Dhaann on Sun Mar 22, 2009 6:01 am, edited 1 time in total.
Srowen
Member
Member
Posts: 60
Joined: Thu Feb 26, 2009 2:31 pm
Location: Genova, ITALY

Re: Erros while compiling Bran's Kernel

Post by Srowen »

did you add the gcc line to compile the scrn.c?
Dhaann
Posts: 19
Joined: Fri Dec 19, 2008 1:37 pm

Re: Erros while compiling Bran's Kernel

Post by Dhaann »

yeah... else it wouldn't give an error for scrn.c
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Re: Errors while compiling Bran's Kernel

Post by narke »

Maybe the linker can't find scrn.o.
Do you specified the path correctly?

Also give us your Makefile.
OS for PowerPC Macs: https://github.com/narke/Einherjar
Operating system: colorForth computing environment for x86.: https://github.com/narke/Roentgenium
Windryder
Posts: 2
Joined: Fri Mar 13, 2009 4:02 am

Re: Errors while compiling Bran's Kernel

Post by Windryder »

Did you pass -Werror to gcc? As far as I can see it only outputs warnings, and unless warnings are treated as errors it should produce an object file. Make sure that the command to compile scrn.c actually outputs to scrn.o. Also, make sure that all the files are in the correct directory.
Dhaann
Posts: 19
Joined: Fri Dec 19, 2008 1:37 pm

Re: Errors while compiling Bran's Kernel

Post by Dhaann »

Sorry, forgot the build.bat! But now I even get or errors:

Image
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Re: Errors while compiling Bran's Kernel

Post by Zenith »

It looks like the tutorial compiled successfully - I don't see any compilation-terminating errors, just warnings. (Note the little "Done!" message at the end.)

These warnings, are probably caused by... I'll call them "oversights"... in the actual code (such as not using the same unsigned types or casting pointers to integers). Shame on Bran's tutorial! SHAAAAME!!! :twisted: </standards nazi>

I'm pretty sure editing the code would fix most, if not all of these warnings.

Good luck!
"Sufficiently advanced stupidity is indistinguishable from malice."
Post Reply