在看nginx 源碼是看到頭文件包含都是 使用 #include <ngx_core.h> #include <nginx.h>
類似格式, 在 IDE 中會(huì)報(bào)錯(cuò)找不到文件
這些文件不是在系統(tǒng)目錄里,為什么要使用 "<>"
以下節(jié)選自ISO/IEC 9899:1999原文:
# include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the<
and>
delimiters, and causes the replacement of that directive by the entire contents of the header.How the places are specified or the header identified is implementation-defined.
注意到最后了嗎,implementation-defined——沒(méi)人規(guī)定說(shuō)就是系統(tǒng)目錄,而且很多編譯器的默認(rèn)行為也不是僅查找系統(tǒng)目錄。即使是同一種編譯器,具體的行為尚且可能取決于你提供的選項(xiàng)呢,何況C語(yǔ)言編譯器五花八門。