xcode 升级了, 发现很多头文件找不到了
-
clang的版本
-
源码
#include <stdio.h>
int main() {
printf("Hello world\n");
}
- 代码报错
clang test.c -o test
test.c:1:9: fatal error: 'stdio.h' file not found
#include<stdio.h>
如何解决?
主要是缺少了Tool chain
xcode-select --install #重点
或者
clang test.c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk #重点是-isysroot
clang -### test.c -o test
-###
Print (but do not run) the commands to run for this compilation
本文介绍了解决Xcode升级后导致头文件找不到的问题。主要原因是Toolchain配置缺失,可通过xcode-select --install命令或指定isysroot参数来解决。文章提供了具体的命令示例。

9214

被折叠的 条评论
为什么被折叠?



