【发布时间】:2020-01-25 22:09:37
【问题描述】:
我明白了。编译一个简单的ciao.c program时出错
In file included from ciao.c:1:
/usr/local/lib/gcc/x86_64-apple-darwin18.5.0/8.3.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~~
compilation terminated.
我已经安装了 Xcode、命令行工具和你想要的,但是没有。
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
你能帮帮我吗?
【问题讨论】:
-
使用这个
#include <stdio.h> -
检查Can't compile C program on a Mac after upgrade to Mojave——它可能会对你有所帮助。
-
您似乎使用的是“真实的”
gcc(而不是 XCode 中的gcc,实际上是伪装的clang(/usr/bin/gcc --version可能会产生Apple clang version 11.0.0 (clang-1100.0.33.8) — Target: x86_64-apple-darwin18.7.0或类似的东西) (来自 XCode 11.0)。错误消息来自“真正的”GCC。它表明/usr/include中存在问题 — 在我的机器上/usr/include下有三个文件_stdio.h(在/usr/include中,@ 987654335@ 和/usr/include/secure) — 也许其他问题会对您有所帮助。