compiling without -ffreestanding

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
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

compiling without -ffreestanding

Post 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?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: compiling without -ffreestanding

Post by Octocontrabass »

Are you using a cross compiler?
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: compiling without -ffreestanding

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: compiling without -ffreestanding

Post 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?
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: compiling without -ffreestanding

Post 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)
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: compiling without -ffreestanding

Post 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.)
Post Reply