WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: gcc | fatal error: stdio.h: No such file or directory  (Read 4901 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
gcc | fatal error: stdio.h: No such file or directory
« on: February 04, 2017, 10:21:52 PM »
Hi all,

I was trying to write a simple c code, but getting "fatal error: stdio.h: No such file or directory" error when compiling it.
I've confirmed that "stdio.h" is there. See the details & the code below.

Code: [Select]
tc@box:~/c$ cat hello.c
#include <stdio.h>

int
main (void)
{
  printf ("Hello, world!\n");
  return 0;
}
tc@box:~/c$

COMPILE IT, but getting error
Code: [Select]
tc@box:~/c$ gcc hello.c -o hello
hello.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
tc@box:~/c$

No output created
Code: [Select]
tc@box:~/c$ ls -lh
total 4
-rw-r--r--    1 tc       staff         82 Feb  5 06:08 hello.c
tc@box:~/c$

stdio.h is there
Code: [Select]
tc@box:~/c$ sudo slocate -u
tc@box:~/c$ sudo slocate stdio.h
/usr/local/include/c++/5.2.0/tr1/stdio.h
/usr/local/lib/gcc/i486-pc-linux-gnu/5.2.0/include/ssp/stdio.h
/usr/local/lib/perl5/5.22.0/i486-linux/CORE/nostdio.h
tc@box:~/c$

Please advise

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: gcc | fatal error: stdio.h: No such file or directory
« Reply #1 on: February 04, 2017, 10:29:28 PM »
Did you install compiletc.tcz?

Also, without providing TC version and architecture hard to help. Is it ARM, x86_6.4, 8.0, 7.1, ... ?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Adam

  • Full Member
  • ***
  • Posts: 121
[SOLVED] gcc | fatal error: stdio.h: No such file or directory
« Reply #2 on: February 04, 2017, 10:57:29 PM »
Thanks bmarkus  :)
I didn't know that compiletc.tcz is required.

Download
Code: [Select]
tce-load -wi compiletc.tcz
Code: [Select]
tc@box:~/c$ gcc hello.c -o halow
tc@box:~/c$ ls -lh
total 12
-rwxr-xr-x    1 tc       staff       6.5K Feb  5 06:55 halow
-rw-r--r--    1 tc       staff         82 Feb  5 06:08 hello.c
tc@box:~/c$ ./halow
Hello, world!
tc@box:~/c$