fatal error: stdio.h: No such file or directory #include What to do when <stdio.h> appears

Introduction

When I tried to compile by programming in C language for the first time in a long time, I could not compile. When you check the error details

fatal error: stdio.h: No such file or directory #include <stdio.h>

No, let me even set the stage for programming C language. .. .. I thought Leave a solution as a result of various investigations.

Execution environment

Mac OS high Sierra(Macbook Air early2015)

solution

In conclusion,

xcode-select --install

Just run this in the terminal lol Why is that so? It seems that such an error occurs because the header file of stdio.h, which should have been in the usr directory, has disappeared. It seems that the original OS disappeared when I updated to High Sierra with El Capitan. Why not just download the stdio.h header file and put it directly in the usr directory? I thought, so I downloaded it and tried to put it in the usr directory, but it was impossible due to the authority. So, if you execute the above command in the terminal, it seems that it will install what you need for C language, so it seems to be solved.

Recommended Posts