GCC致命错误:stdio.h中:没有这样的文件或目录 [英] GCC fatal error: stdio.h: No such file or directory

查看:5635
本文介绍了GCC致命错误:stdio.h中:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用C编译程序在OS X 10.9与GCC 4.9(实验)。出于某种原因,我得到下面的错误在编译时:

I'm trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I'm getting the following error at compile time:

gcc: fatal error: stdio.h: No such file or directory

我又试图一个简单的Hello World程序:

I then tried a simple Hello World program:

#include <stdio.h>

int main(int *argc, const char *argv[])
{
    printf("Hello, world!");
    return 0;
}

再次运行时的gcc -o〜/你好〜/ hello.c的,我得到了同样的错误。我使用 GCC 的实验版本,但似乎很难相信会有哪个产生的错误在导入发布 STDIO 。这可能是造成这个问题,怎么能解决吗?

Again, upon running gcc -o ~/hello ~/hello.c, I got the same error. I'm using an experimental version of gcc, but it seems implausible that there would be a release which generated errors upon importing stdio. What could be causing this issue, and how can it be fixed?

推荐答案

我有这个问题太(通过MacPorts的编译器遇到的)。 X $ C $的c previous版本将让你通过X code / preferences安装的命令行工具,但X code5并没有给在GUI中的命令行工具选项,所以我认为它是自动现已列入。尝试运行此命令:

I had this problem too (encountered through Macports compilers). Previous versions of Xcode would let you install command line tools through xcode/Preferences, but xcode5 doesn't give a command line tools option in the GUI, that so I assumed it was automatically included now. Try running this command:

xcode-select --install

这篇关于GCC致命错误:stdio.h中:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆