Visual Studio 2013 header 包含失败

Visual Studio 2013 header include failed

有谁知道,为什么我不能包含我的 header 文件,尽管它们在同一个文件夹中?我只是在这个例子中使用 #include < inout.h >。环境是Microsoft Visual Studio 2013 Ultimate。 也为德语感到抱歉,但我认为它仍然可以理解。谢谢您的帮助。 failing header include

您的主要问题是 #include <inout.h> 会在系统 headers 中开始搜索,而 #include "inout.h" 会先检查您的本地目录,然后再继续检查系统路径。

A preprocessing directive of the form

#include <h-char-sequence>

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.

A preprocessing directive of the form

#include "q-char-sequence"

causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the " delimiters. The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read

#include <h-char-sequence>

with the identical contained sequence (including > characters, if any) from the original directive.

虽然应该说这是编译器相关的,所以不一定总是这样,但这就是你出错的原因。