Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

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

$
0
0

I wonder what is the recommended directory structure for a simple solution that consists of several projects:

Project 1: App1 - Main application that interacts with C++ objects from Lib1 and Dll1

Project 2: Lib1 - Static library containing class CLib1

Project 3: Dll1 - Dynamic library  containing class CDll1

The default layout sets a directory for each project, all under a solution folder. Each project folder includes all source (.h, .cpp) files, resource files (.rc, .ico) and project management.

The default target folders are all under the solution folder - Debug, Release, x64\Debug and x64\Debug

It seems that we have a problem with the include files as they all reside in their respective folders. For example, file App1.cpp will not be able to link with Lib1.lib with out adding '#include "..\Lib1\Lib1.h" or adding this folder to its include path. I don't like the first solution as it involves a search path with is not pure-relative. The latter one will cause a long and error prone include path (as the number of libraries might be large).

Any standard solution you can think of? Thank you.


Viewing all articles
Browse latest Browse all 21115

Trending Articles



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