Reputation: 11972
I have a nested folder structure in my project, where each folder corresponds to a namespace. For example I have these 2 files:
a::b::c::MyClass.h
util::OtherClass.h
The problem is that I end up with include statements like this:
#include "../../../util/OtherClass.h"
How can I avoid this, Is it possible to reference the project root somehow? I would prefer to reference the include path as just #include "/util/OtherClass.h"
;
I'm using VS 2013 Express
Upvotes: 0
Views: 546
Reputation: 21544
You can simply add the root project folder to the include directory list (in the project's options dialog in Visual Studio).
Then, relative files from this folder will be accessible, so #include "util/OtherClass.h"
will work (if util
is in a folder listed in the include directory list).
Upvotes: 2