linux 查看gcc安装目录,如何查看和修改gcc/g++默认include路径

  • Post author:
  • Post category:linux


一、如何查看gcc/g++默认include路径

安装gcc:yum install gcc

安装g++:yum install gcc-c++

1、查看gcc的include路径命令:

`gcc -print-prog-name=cc1` -v

`g++ -print-prog-name=cc1` -v

2、查看g++的include路径命令:

`gcc -print-prog-name=cc1plus` -v

`g++ -print-prog-name=cc1plus` -v

CentOS release 6.4 (Final)下面执行:

[root@ebs-19233 ~]# `gcc -print-prog-name=cc1` -v

忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include-fixed”

忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../x86_64-redhat-linux/include”

#include “…” 搜索从这里开始:

#include <…> 搜索从这里开始:

/tmp

/usr/local/include

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include

/usr/include

搜索列表结束。