OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:12 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Build cross compiler but when compiling include error linux
PostPosted: Wed May 24, 2017 2:15 am 
Offline
Member
Member

Joined: Sat Apr 29, 2017 6:56 am
Posts: 26
I build a cross compiler i successfully installed but when compiling include error appearing.
$ i686-elf-gcc main.c -o main
main.c:1:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.


I installed in $HOME/opt/cross when i run command i686-elf-gcc main.c -o main
Error command not found


Last edited by yerri07 on Wed May 24, 2017 2:56 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 2:21 am 
Offline
Member
Member

Joined: Tue May 13, 2014 3:02 am
Posts: 280
Location: Private, UK
You obviously haven't ported/written a C standard library for your OS/kernel. Do you think the functions in "stdio.h" will "magically" know how to operate your device/file I/O implementation?

Remove the "#include" and see which functions are needed. Implement them. Problem solved.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 2:50 am 
Offline
Member
Member

Joined: Sat Apr 29, 2017 6:56 am
Posts: 26
I didn't created the code for Kernel . i just wanted to test the gcc is working or not?. When i compiled without header got


Error command not found


Last edited by yerri07 on Wed May 24, 2017 2:57 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 2:57 am 
Offline
Member
Member

Joined: Thu Jul 05, 2007 8:58 am
Posts: 223
You seem to be missing the main point of the cross compiler. It is build such that it does depend on any external runtime. In particular, this means that it is completely unsuited for building programs for your current OS, as it misses the runtime support for that.


Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 3:18 am 
Offline
Member
Member

Joined: Sat Apr 29, 2017 6:56 am
Posts: 26
I know it is not intended for the current Os. My question is Not able to compile and command not found errors


Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 3:28 am 
Offline
Member
Member

Joined: Tue May 13, 2014 3:02 am
Posts: 280
Location: Private, UK
"$HOME/opt/cross" is probably not in your PATH. "stdio.h" is part of the C standard library.

If that doesn't give you enough information to solve your problems, you lack the prerequisite knowledge and experience required for OS development.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 4:20 am 
Offline
Member
Member

Joined: Sat Apr 29, 2017 6:56 am
Posts: 26
I know stdio.h is the c library . Any way i know how to compile Kernel and what to do. I thought c library are installed too, i found those are not installed in opt/cross folder.


Any way thanks for the reply and concern. Have a great day


Top
 Profile  
 
 Post subject: Re: Build cross compiler but when compiling include error li
PostPosted: Wed May 24, 2017 4:44 am 
Offline
Member
Member

Joined: Tue May 13, 2014 3:02 am
Posts: 280
Location: Private, UK
yerri07 wrote:
i found those are not installed in opt/cross folder.


Correct. They don't exist by "magic". You must create them (or the bits of them that you need).

_________________
Image


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], DotBot [Bot] and 60 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