Hello.c:1:19: fatal error: stdio.h: No such file or directory
I get this error after installing a fresh Linux Mint 14. I have added the correct directory to path and can see it when I type "echo $PATH" in terminal.
I am new to Linux and any advice is welcome.
gcc fatal error:stdio.h:No such file or directory
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
gcc fatal error:stdio.h:No such file or directory
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: gcc fatal error:stdio.h:No such file or directory
What were you trying to do, and how does Hello.c look like?
Re: gcc fatal error:stdio.h:No such file or directory
gcc is a compiler, Hello.c is a source file, stdio.h is a resource file.
The PATH is a variable where binary executables are searched for.
The above two items have absolutely nothign to do with each other!
You were apparently trying to compile something. What are you trying to accomplish, and how are you going about it? We need steps to reproduce to be able to help you.
The PATH is a variable where binary executables are searched for.
The above two items have absolutely nothign to do with each other!
You were apparently trying to compile something. What are you trying to accomplish, and how are you going about it? We need steps to reproduce to be able to help you.
Re: gcc fatal error:stdio.h:No such file or directory
I am attempting to get my feet wet with gcc and linux. I was simply creating a simple program, using Kate, from a tutorial. The 'Hello.c' program file is :
I created a directory named "Temp" under >home>mydir>Projects, and stored Hello.c there.
If I open terminal and go to the "Temp" directory and type "gcc Hello.c -o hello1", the response is
"fatal error: stdio.h: No such file or directory"
My first thought was that stdio.h was not in the PATH, so I added it and checked that the PATH was updated by typing
"echo $PATH"
Another attempt to compile produced the same error message.
That is where I am now. I am hopefully missing something simple.
Code: Select all
#include <stdio.h>
void main
{
printf("Hello World\n");
}
If I open terminal and go to the "Temp" directory and type "gcc Hello.c -o hello1", the response is
"fatal error: stdio.h: No such file or directory"
My first thought was that stdio.h was not in the PATH, so I added it and checked that the PATH was updated by typing
"echo $PATH"
Another attempt to compile produced the same error message.
That is where I am now. I am hopefully missing something simple.
Re: gcc fatal error:stdio.h:No such file or directory
The file should be located under /usr/include and this is the default location so you shouldn't need to tell gcc that. You may first want to double check that you have /usr/include/stdio.h available.
BTW your program won't compile in any case since you've forgotten () after the name of main(). But you didn't get that far.
BTW your program won't compile in any case since you've forgotten () after the name of main(). But you didn't get that far.
Re: gcc fatal error:stdio.h:No such file or directory
I have the same problem, and I found my stdio.h in a completely different directory from /usr/include. How do I tell the system where my header files are? And why would my Mint install not know already?
Re: gcc fatal error:stdio.h:No such file or directory
I am also interested in this. I found stdio.h in /usr/lib/syslinux/com32/include/ directory. Is it OK if i make a symbolic link from here to /usr/include?JasonMel wrote:I have the same problem, and I found my stdio.h in a completely different directory from /usr/include. How do I tell the system where my header files are? And why would my Mint install not know already?
Thanks in advance.
EDIT: it seems not. I got an error message during copiling:
~ $ make hello
cc hello.c -o hello
In file included from hello.c:1:0:
/usr/include/stdio.h:8:26: fatal error: klibc/extern.h: No such file or directory
#include <klibc/extern.h>
^
compilation terminated.
make: *** [hello] Error 1
EDIT2:
This solved the issue:
Code: Select all
sudo apt-get install build-essential
Re: gcc fatal error:stdio.h:No such file or directory
Probably because that other stdio.h is something completely different from the standard stdio.h and it meant to be used in a different context. No I don't know *what* that is, except it's not the same....