Dump include paths from g++

廉价感情. 提交于 2019-11-26 19:31:11

From Jonathan Wakely a better option (works on clang too):

g++ -E -x c++ - -v < /dev/null 
clang++ -E -x c++ - -v < /dev/null

I noticed there's a flag in cpp for specifying language. This works like a charm.

cpp -xc++ -v < /dev/null


#include "..." search starts here:
#include <...> search starts here:
 /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.0/../../../../include/c++/4.7.0
 /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.0/../../../../include/c++/4.7.0/x86_64-apple-darwin11.4.0
 /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.0/../../../../include/c++/4.7.0/backward
 /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.0/include
 /usr/local/include
 /usr/local/Cellar/gcc/4.7.0/gcc/include
 /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.0/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.

Just noticed that it is important for the -x c++ to be -xc++ on gcc 4.2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!