查看编译器的默认include路径


在shell下运行:

Shell代码   收藏代码
  1. $ echo | gcc -v -x c++ -E -  

或者

Shell代码   收藏代码
  1. $ echo | g++ -v -x c++ -E -  

 

可以看到类似如下的结果

Shell代码   收藏代码
  1. Using built-in specs.  
  2. Target: x86_64-redhat-linux  
  3. Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux  
  4. Thread model: posix  
  5. gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)  
  6.  /usr/libexec/gcc/x86_64-redhat-linux/4.1.2/cc1plus -E -quiet -v -D_GNU_SOURCE - -mtune=generic  
  7. ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../x86_64-redhat-linux/include"  
  8. #include "..." search starts here:  
  9. #include <...> search starts here:  
  10.  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2  
  11.  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux  
  12.  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward  
  13.  /usr/local/include  
  14.  /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include  
  15.  /usr/include  
  16. End of search list. 

你可能感兴趣的:(查看编译器的默认include路径)