Xcrun clang --sysroot cannot find stdio.h
With Xcode 4.6, on Mac OS X 10.8.2, to compile hello.c, I issued the xcrun command recommended in xcrun gcc, I can't find the header files , but still got the error that the stdio.h header file was not found.
$ xcrun clang --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -o hello hello.c
hello.c:2:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
$ cat hello.c
/* C program, Hello World */
#include <stdio.h>
int main()
{
printf("Hello World \n");
}
+3
source to share