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 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?
echo "#include <bogus.h>" | gcc -v -x c -
and examining the search paths. – Christian Ternusstdio.h
is in any of GCC's search paths. – Julesint main
's first parameter is an int and not int *argc. – p0lArissudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /usr/include
– Yann Ramin