OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 8:53 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Error in GCC building. <stdio.h> not found?
PostPosted: Tue Nov 21, 2017 6:00 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
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! ;-;

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Tue Nov 21, 2017 6:08 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
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.


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Tue Nov 21, 2017 6:45 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
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)

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Tue Nov 21, 2017 6:49 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
****, I have the file in /usr/include :/
Image

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Wed Nov 22, 2017 11:05 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5103
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.


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Wed Nov 22, 2017 5:43 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
I'm trying to make a Hosted Cross-Compilerq

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Wed Nov 22, 2017 5:45 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
AAAAH now I understand so I need to port Newlib or create mah libc so after this I can build mah hosted CC?

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Error in GCC building. <stdio.h> not found?
PostPosted: Wed Nov 22, 2017 9:56 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 292 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group