Fatal error stdio h linux mint

Linux Mint Forums

[SOLVED] gcc fatal error: stdio.h: No such file or directory

Forum rules
There are no such things as «stupid» questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

[SOLVED] gcc fatal error: stdio.h: No such file or directory

Post by JFitz » Sun Dec 19, 2021 1:24 pm

Hi. Trying to use gcc to compile «hello.c» file and get the error «gcc fatal error: stdio.h: No such file or directory». This happens from Code::Blocks, CodeLite or invoking gcc directly. From googling and this forum, the problem seems to be I need to install «build-essential» but that is «Not Available» in the Software Manager. Attempting to install it from the terminal brings up,

Reading package lists. Done Building dependency tree Reading state information. Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies. build-essential : Depends: libc6-dev but it is not going to be installed or libc-dev Depends: g++ (>= 4:9.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

I have searched around that too but got lost in the technicalities.

What do I have to do to be able to use gcc with Code::Blocks or CodeLite ideally to build and run a C console program please?

System: Kernel: 5.4.0-91-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 5.0.7 wm: muffin 5.0.2 dm: LightDM 1.30.0 Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal Machine: Type: Desktop Mobo: ASUSTeK model: RAMPAGE IV FORMULA v: Rev 1.xx serial: BIOS: American Megatrends v: 2105 date: 08/04/2012 CPU: Topology: 6-Core model: Intel Core i7-3930K bits: 64 type: MT MCP arch: Sandy Bridge rev: 6 L2 cache: 12.0 MiB flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 76843 Speed: 1201 MHz min/max: 1200/3800 MHz Core speeds (MHz): 1: 1201 2: 1200 3: 1201 4: 1202 5: 1201 6: 1201 7: 1201 8: 1201 9: 1201 10: 1201 11: 1201 12: 1201 Graphics: Device-1: NVIDIA GP104 [GeForce GTX 1070] vendor: ZOTAC driver: nvidia v: 460.91.03 bus ID: 03:00.0 chip ID: 10de:1b81 Display: x11 server: X.Org 1.20.13 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa resolution: 1680x1050~60Hz OpenGL: renderer: GeForce GTX 1070/PCIe/SSE2 v: 4.6.0 NVIDIA 460.91.03 direct render: Yes Audio: Device-1: Intel C600/X79 series High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:1d20 Device-2: NVIDIA GP104 High Definition Audio vendor: ZOTAC driver: snd_hda_intel v: kernel bus ID: 03:00.1 chip ID: 10de:10f0 Device-3: M-Audio Keystation Mini 32 MK3 type: USB driver: snd-usb-audio bus ID: 5-1:2 chip ID: 0763:3111 Sound Server: ALSA v: k5.4.0-91-generic Network: Device-1: Intel 82579V Gigabit Network vendor: ASUSTeK P8P67 Deluxe driver: e1000e v: 3.2.6-k port: f040 bus ID: 00:19.0 chip ID: 8086:1503 IF: eno1 state: up speed: 100 Mbps duplex: full mac: Drives: Local Storage: total: 1.14 TiB used: 89.23 GiB (7.7%) ID-1: /dev/sda vendor: Samsung model: SSD 870 EVO 250GB size: 232.89 GiB speed: 6.0 Gb/s serial: rev: 1B6Q scheme: MBR ID-2: /dev/sdb vendor: Western Digital model: WD10EZRZ-00HTKB0 size: 931.51 GiB speed: 3.0 Gb/s rotation: 5400 rpm serial: rev: 1A01 scheme: GPT Partition: ID-1: / size: 227.74 GiB used: 34.72 GiB (15.2%) fs: ext4 dev: /dev/sda5 Sensors: System Temperatures: cpu: 34.0 C mobo: N/A gpu: nvidia temp: 41 C Fan Speeds (RPM): N/A gpu: nvidia fan: 0% Repos: No active apt repos in: /etc/apt/sources.list Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 1: deb http://www.mirrorservice.org/sites/packages.linuxmint.com/packages uma main upstream import backport 2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse 3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse 4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse 5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse 6: deb http://archive.canonical.com/ubuntu/ focal partner Info: Processes: 328 Uptime: 2h 03m Memory: 15.59 GiB used: 2.00 GiB (12.8%) Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Источник

Читайте также:  Ждущий режим linux команда

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

I’m trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I’m getting the following error at compile time:

gcc: fatal error: stdio.h: No such file or directory 
#include int main(int argc, const char *argv[])

Again, upon running gcc -o ~/hello ~/hello.c , I got the same error. I’m using an experimental version of gcc , but it seems implausible that there would be a release which generated errors upon importing stdio . What could be causing this issue, and how can it be fixed?

You can see where gcc is looking for header files by doing echo «#include » | gcc -v -x c — and examining the search paths.

Mavericks no longer has a base /usr/include. You need to link it into place from the XCode OS 10.9 SDK.

@user2615799 Its at sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /usr/include

5 Answers 5

macOS

I had this problem too (encountered through Macports compilers). Previous versions of Xcode would let you install command line tools through xcode/Preferences, but xcode5 doesn’t give a command line tools option in the GUI, that so I assumed it was automatically included now. Try running this command:

If you see an error message that developer tools are already installed (and still header files can’t be found), wipe out any existing one to do a fresh installation:

sudo rm -rf /Library/Developer/CommandLineTools 

Ubuntu

sudo apt-get install libc6-dev 

Источник

Linux Mint Forums

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

Forum rules
Before you post please 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

Post by lmitcham » Wed Jan 30, 2013 4:39 pm

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.

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.

bjornmu Level 3
Posts: 189 Joined: Wed Dec 19, 2012 2:50 am Location: Trondheim, Norway

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

Post by bjornmu » Wed Jan 30, 2013 6:11 pm

SiKing Level 5
Posts: 571 Joined: Mon Sep 29, 2008 10:57 pm Location: Las Vegas Contact:

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

Post by SiKing » Wed Jan 30, 2013 6:39 pm

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.

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

Post by lmitcham » Thu Jan 31, 2013 8:48 am

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 :

Читайте также:  Linux mint russian forum

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.

bjornmu Level 3
Posts: 189 Joined: Wed Dec 19, 2012 2:50 am Location: Trondheim, Norway

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

Post by bjornmu » Thu Jan 31, 2013 12:38 pm

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.

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

Post by JasonMel » Thu Sep 11, 2014 5:37 pm

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

Post by Zetor895 » Tue Sep 23, 2014 8:25 am

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?

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?
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
^
compilation terminated.
make: *** [hello] Error 1

EDIT2:
This solved the issue:

 sudo apt-get install build-essential

Источник

Оцените статью
Adblock
detector