【发布时间】:2013-02-15 20:43:30
【问题描述】:
使用Xcode 4.6,在Mac OS X 10.8.2下,编译hello.c,我发出了xcrun gcc cannot find header files推荐的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");
}
【问题讨论】: