Jules Jules - 1 year ago 237
C Question

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

I then tried a simple Hello World program:

#include <stdio.h>

int main(int *argc, const char *argv[])
printf("Hello, world!");
return 0;

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

Answer Source

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:

xcode-select --install
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download