I have to include many header files, which are in different sub-directories. Is there a way in Visual Studio (I am using 2005 edition) to set one include path that Visual Studio will search also the sub-directories for header files?
C++ – How to include sub-directories in Visual Studio
c++includevisual-studiovisual-studio-2005
Related Question
- Visual-studio – Should I add the Visual Studio .suo and .user files to source control
- Visual-studio – What are the various “Build action” settings in Visual Studio project properties and what do they do
- C++ – The Definitive C++ Book Guide and List
- Visual-studio – How to add an existing directory tree to a project in Visual Studio
- Javascript – How to include a JavaScript file in another JavaScript file
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C++ – Why are elementwise additions much faster in separate loops than in a combined loop
Best Solution
Setting the folder search paths in the Visual Studio settings to fix an include issue is generally not really a good idea from a design point of view. Your code will be less portable to different machines with different directory lay-outs.
My suggestion would be to settle on an organisation of your code so that the relative paths of the sub-directories (relative to your including code) are fixed:
#include "subdirectory/somefile.h"
.This has the added bonus of being able to see which folder in your Solution contains the file - that is often useful information when you're trying to find your way around or trying to figure out what a file is for.