Oscar
Oscar

Reputation: 299

How to add all subdirectories in "Include directories" in Visual Studio?

When cloning a repo on github, I have made with lots of subfolders (like src, include and then several sub-directories in those) on a new PC. But I get a heap of errors that it can't find the paths for the include files. How do I quickly let Visual Studio know to look for include files in those sub-directories and not just the main folder where I cloned the repo?

Going into properties and choosing "include directories" I can manually select paths to look for include files, but I obviously don't want to manually add the dozens of sub-folders where include files can be found. Preferably I would like whoever is cloning the repo to not have to worry about this at all of course if there is something to do about this when creating the repo. Thank you!

The github repo for reference: https://github.com/OscarUngsgard/Cpp-Monte-Carlo-Value-at-Risk-Engine

And a picture of the "include directories" options I'm referring to in Visual Studio: enter image description here

Upvotes: 2

Views: 1202

Answers (1)

Nikhil Ghule
Nikhil Ghule

Reputation: 124

As far as I know there's no way to search for include files in subfolders. And it's obvious if this was possible it would not be relevant to do that as this will take more time to search them.

But you can do one thing, when including files just add their relative path Such as

#include "../src/header_file.h"

Upvotes: 2

Related Questions