什么是 GCC 默认包含目录? [英] What are the GCC default include directories?

查看:46
本文介绍了什么是 GCC 默认包含目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用 gcc 编译一个非常简单的源文件时,我不必指定标准包含文件的路径,例如 stdio 或 stdlib.

When I compile a very simple source file with gcc I don't have to specify the path to standard include files such as stdio or stdlib.

GCC 如何知道如何找到这些文件?

How does GCC know how to find these files?

它是否有硬连线的 /usr/include 路径,或者它会从其他操作系统组件获取路径?

Does it have the /usr/include path hardwired inside, or it will get the paths from other OS components?

推荐答案

为了找出gcc/g++使用的默认路径,以及它们的优先级,您需要检查以下命令的输出:

In order to figure out the default paths used by gcc/g++, as well as their priorities, you need to examine the output of the following commands:

  1. 对于C:

    gcc -xc -E -v -

  1. 对于C++:

    gcc -xc++ -E -v -

感谢 Qt Creator 团队.

The credit goes to Qt Creator team.

这篇关于什么是 GCC 默认包含目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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