Hi, I'm using Visual Studio 2008 as my IDE for learning C++, and I am having compilation errors when I try to link self-created header files using pointy brackets < >, but it works when I use double-quotes "". For standard library files, pointy brackets < > work fine. Is this a Visual Studio setting that can be altered?
#include <iostream> //compiles properly
#inclue <selfCreatedClass.h> // fatal error C1083: Cannot open include file: 'selfCreatedClass.h': No such file or directory
By convention, <> are only for files that are in one of the project's include paths.
For everything else, use "" (note that using "" will always work, as the compiler must try to include the file using the <> rules before giving up).
When you enclose a header in quotes the compiler start seaching from the directory where your project is resides. When you use brackets the compiler does look through the directory where your project is.
The difference between using "" and <> is implementation defined. The standard mandates that if you include with "" and the file is not found, it will then pretend you used <> and try that out instead (as Athar said), but otherwise it's completely up to the implementation (ISO C++ 11 standard, sections 16.2.2 and 16.2.3). Some implementation may do as Vlad describes, some may not; it's up to them.