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

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

问题描述

在OSX上,当我使用外部提供的编译器(例如gcc-4.8)时,无法从命令行编译简单程序。不能找到像 limits.h 这样的系统标题。

On OSX, I can't compile simple programs from the command-line when I use an externally-provided compiler (e.g. gcc-4.8). System headers like limits.h cannot be found.

错误消息示例:

fatal error: limits.h: No such file or directory

或者:

Or:

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

等等。

有什么不对?

推荐答案

请确保您安装了xcode命令行工具:

Make sure you've installed the xcode command-line tools:

xcode-select --install

(接受弹出对话框。)

这会将系统标头安装到gcc等工具预期的标准位置。 / usr / include

That will install system headers into standard locations expected by tools like gcc, e.g. /usr/include.

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

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