gcc如何获取系统头文件路径

使用命令:gcc -v main.c

也就是gcc -v 有效C源文件

注意-v后面要加有效C源文件后,输出信息才包含系统头文件路径

gcc -v的输出:

使用内建 specs。
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.5.1/lto-wrapper
目标:i686-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
线程模型:posix

gcc 版本 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)


gcc -v main.c的输出:

使用内建 specs。
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.5.1/lto-wrapper
目标:i686-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
线程模型:posix
gcc 版本 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.5.1/cc1 -quiet -v main.c -quiet -dumpbase main.c -mtune=generic -march=i686 -auxbase main -version -o /tmp/ccHNJSgt.s
GNU C (GCC) 版本 4.5.1 20100924 (Red Hat 4.5.1-4) (i686-redhat-linux)
    由 GNU C 版本 4.5.1 20100924 (Red Hat 4.5.1-4) 编译,GMP 版本 4.3.1,MPFR 版本 2.4.2,MPC 版本 0.8.1
GGC 准则:--param ggc-min-expand=100 --param ggc-min-heapsize=131072
忽略不存在的目录“/usr/lib/gcc/i686-redhat-linux/4.5.1/include-fixed”
忽略不存在的目录“/usr/lib/gcc/i686-redhat-linux/4.5.1/../../../../i686-redhat-linux/include”
#include "..." 搜索从这里开始:
#include <...> 搜索从这里开始:
 /usr/local/include
 /usr/lib/gcc/i686-redhat-linux/4.5.1/include
 /usr/include
搜索列表结束。

GNU C (GCC) 版本 4.5.1 20100924 (Red Hat 4.5.1-4) (i686-redhat-linux)
    由 GNU C 版本 4.5.1 20100924 (Red Hat 4.5.1-4) 编译,GMP 版本 4.3.1,MPFR 版本 2.4.2,MPC 版本 0.8.1
GGC 准则:--param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 96e2ff891a3517bf2aed246a142fe05d
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 as -V -Qy --32 -o /tmp/ccYxkDxw.o /tmp/ccHNJSgt.s
GNU assembler version 2.20.51.0.7 (i686-redhat-linux) using BFD version version 2.20.51.0.7-5.fc14 20100318
COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.5.1/:/usr/libexec/gcc/i686-redhat-linux/4.5.1/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.5.1/:/usr/lib/gcc/i686-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.5.1/:/usr/lib/gcc/i686-redhat-linux/4.5.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.5.1/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc/i686-redhat-linux/4.5.1/../../../crt1.o /usr/lib/gcc/i686-redhat-linux/4.5.1/../../../crti.o /usr/lib/gcc/i686-redhat-linux/4.5.1/crtbegin.o -L/usr/lib/gcc/i686-redhat-linux/4.5.1 -L/usr/lib/gcc/i686-redhat-linux/4.5.1/../../.. /tmp/ccYxkDxw.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-redhat-linux/4.5.1/crtend.o /usr/lib/gcc/i686-redhat-linux/4.5.1/../../../crtn.o


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值