Page 1 of 1
compiling without -ffreestanding
Posted: Tue Oct 11, 2016 1:59 am
by NunoLava1998
I have my "dobin.bat" file and it is complaining that #include-next stdint.h doesn't exist, but there is stdint.h in the directory.
This problem is resolved by -ffreestanding, however, that brings up a bunch of useless errors that aren't even errors that would require a million edits to my code and OSDev (even extern is not a thing, apparently.). How do i make it so i get the effects of no -ffreestanding but the compiler can load stdint.h?
Re: compiling without -ffreestanding
Posted: Tue Oct 11, 2016 2:02 am
by Octocontrabass
Are you using a cross compiler?
Re: compiling without -ffreestanding
Posted: Tue Oct 11, 2016 2:03 am
by NunoLava1998
Octocontrabass wrote:Are you using a cross compiler?
i686 cross-compiler (GCC). Exactly what OSDev wants. I'm used a compiled-to-exe version from "Ghost", a user here on OSDev, and it works wonderfully.
Re: compiling without -ffreestanding
Posted: Tue Oct 11, 2016 2:05 am
by Octocontrabass
What's your compilation command line?
If your code files aren't all in the same directory, what does your directory structure look like?
Re: compiling without -ffreestanding
Posted: Tue Oct 11, 2016 2:15 am
by NunoLava1998
Fixed it (simply put it in a bunch of folders, but it was probably include-fixed). Same result as with -ffreestanding now. How do i make the compiler force compile it or ignore the errors? (or both)
Re: compiling without -ffreestanding
Posted: Tue Oct 11, 2016 2:39 am
by Octocontrabass
NunoLava1998 wrote:Fixed it (simply put it in a bunch of folders, but it was probably include-fixed).
Freestanding headers like stdint.h are part of the compiler. You shouldn't need to do anything besides #include <stdint.h> in your code in order to use them. It sounds like there's something wrong with your build system.
NunoLava1998 wrote:How do i make the compiler force compile it or ignore the errors? (or both)
You don't. You have to fix them, that's why they're errors instead of warnings. (And really, you should fix warnings too. That's why we recommend -Werror in your compiler flags.)