Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

fatal error: stdio.h: No such file or directory

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
devik
Posts: 4
Joined: 2015-09-18 00:07

fatal error: stdio.h: No such file or directory

#1 Post by devik »

I’m new to C programming so I wrote the following program to see if everything I needed to write programs with GCC and the standard C library was already installed.
I am having issues in OS 10.10.5, where I am unable to build and compile some simple code, either using Xcode or Sublime text.
I decided to install Linux Mint in Virtual Box to see if it would work.

Code: Select all

#include <stdio.h>

void main()

{
 printf("Hello! This is my first C program with Linux Mint\n");

}
For some reason, I'm getting the following error:

mint@mint-VirtualBox ~/Desktop $ gcc hello.c -o hello1
hello.c:2:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>

mint@mint-VirtualBox ~/Desktop $ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks in advance.


User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: fatal error: stdio.h: No such file or directory

#3 Post by GarryRicketson »

Welcome to:
Debian User Forums

I am having issues in OS 10.10.5, where I am unable to build and compile some simple code, either using Xcode or Sublime text.
I decided to install Linux Mint in Virtual Box to see if it would work.
So where does Debian come into the pitcher ?
This may be of some help, since you are using a mac, OS .
https://solarianprogrammer.com/2015/05/ ... -mac-os-x/

Anyway, I would suggest doing it all on the real computer, and not trying to do this using a VM, and since you are using Linux Mint, or Ubuntu, ..that is not clear, but neither is Debian. The above link posted by
Post by fireExit » 2015-09-17 18:40
http://forums.linuxmint.com/
Would be best.

You must have a compiler installed, and since you are just starting out, complicating the whole thing by using a VM is not a good idea.
I did some search for you, that is how I got the above url,
Just copy and paste the key words:
I am having issues in OS 10.10.5
into Search There are many sites listed related to your machine and OS.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: fatal error: stdio.h: No such file or directory

#4 Post by stevepusser »

It's not a problem limited to Mint or Ubuntu. Even without doing a web search for the error + Debian, I'm going to guess that you don't have libc6-dev installed. Install it, then see if that fixes the problem.

Also make sure you have the build-essential metapackage installed.
MX Linux packager and developer

devik
Posts: 4
Joined: 2015-09-18 00:07

Re: fatal error: stdio.h: No such file or directory

#5 Post by devik »

Being new at Linux or C does not excuse me from posting in a forum that is not related to the OS that I am using. However I am glad that I did as the help so far provided seems more useful than the other paths I have followed before coming to this forum.
Thank you for the links and for the brief explanation.
GarryRicketson wrote:Welcome to:
Debian User Forums

I am having issues in OS 10.10.5, where I am unable to build and compile some simple code, either using Xcode or Sublime text.
I decided to install Linux Mint in Virtual Box to see if it would work.
So where does Debian come into the pitcher ?
This may be of some help, since you are using a mac, OS .
https://solarianprogrammer.com/2015/05/ ... -mac-os-x/

Anyway, I would suggest doing it all on the real computer, and not trying to do this using a VM, and since you are using Linux Mint, or Ubuntu, ..that is not clear, but neither is Debian. The above link posted by
Post by fireExit » 2015-09-17 18:40
http://forums.linuxmint.com/
Would be best.

You must have a compiler installed, and since you are just starting out, complicating the whole thing by using a VM is not a good idea.
I did some search for you, that is how I got the above url,
Just copy and paste the key words:
I am having issues in OS 10.10.5
into Search There are many sites listed related to your machine and OS.

devik
Posts: 4
Joined: 2015-09-18 00:07

Re: fatal error: stdio.h: No such file or directory

#6 Post by devik »

I have installed the packages that you suggested and it compiled successfully :D .
Now I need to solve the problem in OSX 10.10.5 :?
Thanks a lot :D :mrgreen:

stevepusser wrote:It's not a problem limited to Mint or Ubuntu. Even without doing a web search for the error + Debian, I'm going to guess that you don't have libc6-dev installed. Install it, then see if that fixes the problem.

Also make sure you have the build-essential metapackage installed.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: fatal error: stdio.h: No such file or directory

#7 Post by stevepusser »

Let us know if that helps--libc6-dev provides the C library headers, and that's what you're missing.
MX Linux packager and developer

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: fatal error: stdio.h: No such file or directory

#8 Post by GarryRicketson »

devik wrote:Being new at Linux or C does not excuse me from posting in a forum that is not related to the OS that I am using. However I am glad that I did as the help so far provided seems more useful than the other paths I have followed before coming to this forum.
Thank you for the links and for the brief explanation.
Your welcome, and no problem,

Any way, the sub forum "programming" is for programming stuff, C, or C+, etc., it does not matter much, what the OS is.

devik
Posts: 4
Joined: 2015-09-18 00:07

Re: fatal error: stdio.h: No such file or directory

#9 Post by devik »

Yes it did. I installed the packages in the virtual machine and it solved the problem.
Now I can code in the virtual machine while the problem is not solved in OSX.
Thanks again
stevepusser wrote:Let us know if that helps--libc6-dev provides the C library headers, and that's what you're missing.

Post Reply