使用Xcode 4.6,在Mac OS X 10.8.2下,为了编译hello.c,我发出了xcrun gcc中推荐的xcrun命令找不到头文件,但仍然收到找不到头文件stdio.h的错误。
$ 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");
}