Skip to content

Commit

Permalink
技巧:打印头文件搜索路径
Browse files Browse the repository at this point in the history
  • Loading branch information
xingmingjie committed Jul 14, 2014
1 parent 135a78f commit 54cdec1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# 预处理
Expand Down
26 changes: 26 additions & 0 deletions src/print-header-search-dir.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 54cdec1

Please sign in to comment.