LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1995|回复: 5

请问GCC的include路径是如何确定的[多谢lovepolo解决]

[复制链接]
发表于 2006-10-31 16:29:33 | 显示全部楼层 |阅读模式
如题。
比如

  1. include <stdio.h>
复制代码

这个stdio.h是哪儿?它所在的目录被写入了GCC的哪个配置文件?谢谢!
发表于 2006-10-31 16:58:07 | 显示全部楼层
type "gcc -v"

$gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3 (Debian)
回复 支持 反对

使用道具 举报

发表于 2006-10-31 16:59:54 | 显示全部楼层
so the header files are located at /usr/include/c++/3.2,
and this information was written in /usr/lib/gcc-lib/i386-linux/3.2.3/specs
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-31 18:08:53 | 显示全部楼层
Thank you very much!
回复 支持 反对

使用道具 举报

发表于 2006-10-31 18:18:05 | 显示全部楼层
那是g++的
对gcc,可能是由prefix决定的吧, $prefix/include
回复 支持 反对

使用道具 举报

发表于 2006-11-1 11:51:29 | 显示全部楼层
Post by x11
那是g++的
对gcc,可能是由prefix决定的吧, $prefix/include

同意,gcc缺省的头文件搜索路径是$prefix/include,不过看gcc -v 的输出可以看出,除了缺省的搜索路径外还加上了C++的搜索路径。如果你要自己指定搜索路径的话可以用gcc的-I参数。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表