我在编译一个简单的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;
}
你能帮我吗?
将<_stdio.h>
重命名为<stdio.h>
。
附言以下是对更新问题的更新答案:
尝试使用xcode-select --install
重新安装 Xcode。
我实际上有和你一样的问题;这是步骤,按照它,它可能会帮助你
选择 1:每次打开终端时复制并粘贴以下内容
export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
选择2:如果选择 1 有效,则:
步骤1:将以下代码粘贴到终端中:
open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
步骤2:打开一个新终端,粘贴以下代码:
open /usr/local/lib/gcc/x86_64-apple-darwin18.5.0/8.3.0/include-fixed/
步骤3:复制步骤1中的所有文件文件,您打开的方向(包括(->粘贴到步骤2中,打开的方向(包含固定(
步骤4:当它询问您是否替换文件时,请选择替换。