Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Recommended directory structure for C++ solution - Visual Studio 2012

$
0
0

Is it possible to set an Include search path that will incorporate all projects of a solution?

Here's why I'd like to have that. Maybe someone can offer a neater solution:
Assume you have a multi-project solution. Each project consists of many classes. Each class is implemented as a source+header file.

Some of the projects need to call classes from sibling projects. To do that they require to#include the header file of the called class.

Here are some options that I can think of:

  1. #include "..\Proj1\Class2.h"
  2. #include "Class2.h" + add ..\Proj1 to include search path
  3. #include "Class2.h" + move Class2.h to ..\Include + add $(SolutionDir)Include to include search path

Each option has its fortes and drawbacks:

Option 1: Probably simplest but writing a source file requires knowledge of file structure.

Option 2: Much maintenance and very long search path

Option 3: Much maintenance and requires braking the VC++ directory structure.

I await your opinion.


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>