Page 1 of 1

Errors while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 3:11 am
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

Re: Erros while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 4:50 am
by Srowen
did you add the gcc line to compile the scrn.c?

Re: Erros while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 5:57 am
by Dhaann
yeah... else it wouldn't give an error for scrn.c

Re: Errors while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 6:06 am
by narke
Maybe the linker can't find scrn.o.
Do you specified the path correctly?

Also give us your Makefile.

Re: Errors while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 6:28 am
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.

Re: Errors while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 6:43 am
by Dhaann
Sorry, forgot the build.bat! But now I even get or errors:

Image

Re: Errors while compiling Bran's Kernel

Posted: Sun Mar 22, 2009 9:49 am
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!