开发者

#include <Header.h> is not compiling while #include "Header.h" is compiling

开发者 https://www.devze.com 2023-01-20 12:37 出处:网络
Don\'t understand why #include &开发者_StackOverflow社区lt;Header.h> is not compiling while #include \"Header.h\" is compiling with Visual Studio 2008. Am I missing something?The two forms of #inc

Don't understand why #include &开发者_StackOverflow社区lt;Header.h> is not compiling while #include "Header.h" is compiling with Visual Studio 2008. Am I missing something?


The two forms of #include search for headers differently.

You can find which paths are searched for each form in the #include MSDN documentation.


They have different purposes.

The brackets < and > are for standard header files, while the quotes " are for your header files.

Here is another question with more information regarding this:

What is the difference between #include <filename> and #include "filename"?


when you mention header file <>, it looks in standard includes, but when header file is included with "", starts with current directory,then will look at standard includes. Here, in this case, Header.h is in current directory, may not be in standard includes.

0

精彩评论

暂无评论...
验证码 换一张
取 消