Drahcir
Drahcir

Reputation: 11972

Nested folder structure in Visual Studio - including files

I have a nested folder structure in my project, where each folder corresponds to a namespace. For example I have these 2 files:

The problem is that I end up with include statements like this:

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

Answers (1)

jpo38
jpo38

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

Related Questions