加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xcode – xcrun clang –sysroot找不到stdio.h

发布时间:2020-12-14 19:14:39 所属栏目:百科 来源:网络整理
导读:使用 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.platf
使用 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");
 }

解决方法

它应该与: xcrun clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读