OSDev.org
https://forum.osdev.org/

Error in GCC building. <stdio.h> not found?
https://forum.osdev.org/viewtopic.php?f=1&t=32584
Page 1 of 1

Author:  AwfulMint [ Tue Nov 21, 2017 6:00 pm ]
Post subject:  Error in GCC building. <stdio.h> not found?

I make a search in GCC folder and I found alot of stdio.h files in it so how THEY CANT FIND IT? Here's the pick, all selected files are stdio.h files:
Image

Here's the Cygwin window printscr:
Image

Plz help me m8s! ;-;

Author:  StudlyCaps [ Tue Nov 21, 2017 6:08 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

On second look, you are trying to build the cross-compiler, not the OS. My mistake.

Still, the stdio.h in your gcc directory is not the file that the compiler is looking for. The correct file should be in /usr/include. It appears your cygwin installation is missing this necessary file. I'm not very familiar with cygwin, but this SO post here indicates that you need to install the package cygwin-devel to install the standard c headers.

Wrong info: Presumably you are using a cross compiler to build your OS?

In this case, the compiler will not look for stdio.h in your gcc files, but will expect you to make your own stdio.h and tell the compiler where to find it using a custom include path. This is intentional, as the stdio in gcc will be for your host OS, not for your new OS.

Author:  AwfulMint [ Tue Nov 21, 2017 6:45 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

Thanks m8 I'll try here, an extra info for ya: I'm building a cross-compiles who target mah OS :D, I'm using $HOME/AetherOS/sysroot as sysroot but I don't have a libc created or ported in it. I'll port Newlib after compiling the compiler (lol)

Author:  AwfulMint [ Tue Nov 21, 2017 6:49 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

****, I have the file in /usr/include :/
Image

Author:  Octocontrabass [ Wed Nov 22, 2017 11:05 am ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

Are you trying to build a freestanding cross-compiler or a hosted cross-compiler? You can't build a hosted cross-compiler until after you have a C library for your OS's userspace.

Author:  AwfulMint [ Wed Nov 22, 2017 5:43 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

I'm trying to make a Hosted Cross-Compilerq

Author:  AwfulMint [ Wed Nov 22, 2017 5:45 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

AAAAH now I understand so I need to port Newlib or create mah libc so after this I can build mah hosted CC?

Author:  StudlyCaps [ Wed Nov 22, 2017 9:56 pm ]
Post subject:  Re: Error in GCC building. <stdio.h> not found?

Ah, OK. Do you need a hosted compiler?
It is recommended that you only build a hosted compiler once you are quite far advanced in you OS project and are ready to start porting already existing programs to your OS. Once you have built a freestanding compiler (follow instructions here) you can already write and compile code to run on the bare metal, and you can start on your kernel. You don't need a hosted compiler for that.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/