This MSDN article explains how preprocessor searches for headers depending on the #include
syntax form. Your style is good as Visual C++, Windows Framework, Boost and headers of other frameworks/packages are (usually) outside your project's directory.
Regarding your second question, my advice is to avoid relative paths. If you move around that header, you'll need to adjust that relative path by changing your code which is a bad idea. I'd rather put it within angle brackets and add path to it to /I
option. E.g. you want to include C:\frameworks\frameworkA\include\a.h
in your project, you can use #include <a.h>
and \I "C:\frameworks\frameworkA\include"
It is maybe more descriptive if you add path to the framework root to /I
and then put partial path to its header within angle brackets. E.g. #include <frameworkA\include\a.h>
and /I "C:\frameworks"
. Now it's clear in the code that a.h
belongs to frameworkA
.
Use relative paths only for headers that are within your project's directory (e.g. if you organise code into modules which are in subdirectories of your project and which are not intended to be moved around).