C Stdio. H No Such File or Directory
Gcc Worked Perfectly Fine Until I Updated to Ubuntu 16.04 and Now When I Run: Gcc File. C an Error Shows up: File. C:1:18: Fatal Error: Stdio. H: No Such File...
gcc worked perfectly fine until I updated to Ubuntu 16.04 and now when I run:
gcc file.c
an error shows up:
file.c:1:18: fatal error: stdio.h: No such file or directory
compilation terminated.
I checked if stdio.h was there and it still was in /usr/include/stdio.h. Please help!
5 Answers
First run:
find /usr/include/ -name "stdio.h"
If no files are returned, run:
sudo apt install --reinstall build-essential
That will reinstall any missing files.
Run:
sudo apt install --reinstall gcc-5.4
This reinstalls gcc. Reinstalling sometimes fixes problems.
Install missing library:
sudo apt install libc6-dev
Going into the C/C++ Configurations and adding /usr/include/** fixed it for me.
Go to the View tab if you are using VSCode. Search for C/C++ edit configuration(UI). Copy/paste these paths to the include path section of the configuration.
/usr/include/
/usr/include/x86_64-linux-gnu
/usr/include/linux
/usr/include/c++/9/tr1
/usr/include/c++/9
You have to paste these paths.
Save your .c file and run it as gcc /path in terminal.