diff --git a/src/index.md b/src/index.md index f42b41a..6fd985a 100644 --- a/src/index.md +++ b/src/index.md @@ -3,6 +3,7 @@ * [打印gcc执行的子命令](print-commands-only.md) * [打印优化级别的对应选项](print-level-options.md) * [打印彩色诊断信息](diagnostics-color.md) +* [打印头文件搜索路径](print-header-search-dir.md) * [查看连接库的具体路径](print-file-name.md) # 预处理 diff --git a/src/print-header-search-dir.md b/src/print-header-search-dir.md new file mode 100644 index 0000000..19e5e72 --- /dev/null +++ b/src/print-header-search-dir.md @@ -0,0 +1,26 @@ +# 打印头文件搜索路径 + +## 例子 + + $ gcc -v foo.c + ... + ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" + ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/include" + #include "..." search starts here: + #include <...> search starts here: + /usr/lib/gcc/x86_64-linux-gnu/4.6/include + /usr/local/include + /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed + /usr/include/x86_64-linux-gnu + /usr/include + End of search list. + ... + +## 技巧 + +如上所示,使用`-v`选项可以打印出gcc搜索头文件的路径和顺序。当然,也可以使用`-###`选项 + +## 贡献者 + +xmj +