WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] C program: <stdio.h> No such file or directory  (Read 3955 times)

Offline ferran

  • Full Member
  • ***
  • Posts: 159
[Solved] C program: <stdio.h> No such file or directory
« on: April 27, 2020, 03:07:32 PM »
Oh, broh...

When i wanted to compile a C program like this:

Code: [Select]
tc@box:~/Code/C$ gcc accounts.c -o accounts

accounts.c:1:10: fatal error: stdio.h: No such file or directory
    1 | #include <stdio.h>
      |          ^~~~~~~~~
compilation terminated.

tc@box:~/Code/C$ find / -type f -name "stdio.h"

find: /mnt/sda1/lost+found: Permission denied
/tmp/tcloop/gcc/usr/local/include/c++/9.2.0/tr1/stdio.h
/tmp/tcloop/gcc/usr/local/lib/gcc/i486-pc-linux-gnu/9.2.0/include/ssp/stdio.h
/tmp/tcloop/syslinux/usr/local/share/syslinux/com32/include/stdio.h


I've the idea of write into the program this:

Code: [Select]
#include </tmp/tcloop/gcc/usr/local/include/c++/9.2.0/tr1/stdio.h>
#include </tmp/tcloop/gcc/usr/local/include/c++/9.2.0/tr1/stdlib.h>
.
.

It doesn't seems something too orthodox.

What will happen if the .c executable runs on another machine (and on another distribution with its particular file tree)?.

Thus, How could I do for TC recognize this standand header of C without to have write all its path ?

Thank you in advance.
« Last Edit: April 27, 2020, 04:27:04 PM by Rich »
TC CorePlus v.11.1 i686 & lots of coffe

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Re: C program: <stdio.h> No such file or directory
« Reply #1 on: April 27, 2020, 04:04:28 PM »
False alarm!

I looked up libc-dev.tcz but it didn't exist.

Then I've noticed that in TC there are glibc and I found the glibc_base-dev.tcz where all the header's files appear in it.

It's Solved !!

« Last Edit: April 27, 2020, 04:07:39 PM by ferran »
TC CorePlus v.11.1 i686 & lots of coffe

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: C program: <stdio.h> No such file or directory
« Reply #2 on: April 27, 2020, 04:06:50 PM »
Hi ferran
Did you first install the  compiletc.tcz  extension so you have a proper tool chain installed?

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Re: C program: <stdio.h> No such file or directory
« Reply #3 on: April 27, 2020, 04:10:39 PM »
Hi ferran
Did you first install the  compiletc.tcz  extension so you have a proper tool chain installed?
So don't... currently I've the usual install of TC and never more. Should I do it now?
TC CorePlus v.11.1 i686 & lots of coffe

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: C program: <stdio.h> No such file or directory
« Reply #4 on: April 27, 2020, 04:15:04 PM »
Hi ferran
If you are looking to compile existing programs or a program you are trying to write, you should install  compiletc.tcz.

Offline ferran

  • Full Member
  • ***
  • Posts: 159
Re: C program: <stdio.h> No such file or directory
« Reply #5 on: April 27, 2020, 04:22:16 PM »
Oh yeah ! It contents the glib_base-dev.tcz too  :D

I say again: thank you very much.

It's SOLVED.
TC CorePlus v.11.1 i686 & lots of coffe