views:

3199

answers:

3

Hi

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?

+8  A: 
MadKeithV
A: 

I believe using recursive search for include files would cause so much more problems than it solves in a form of wrong files or wrong versions being included. After all, you have to define the right directories once when you set up the project.

Tuminoid
Wrong.Recursive searches were the default amongst classic Macintosh development environments such as CodeWarrior. They had a simple convention that using parens around a (directory) skipped it being auto-included so you had to add a specific path. This kept the includes list very simple and I have always missed it on Windows.
Andy Dent
+2  A: 

We haven't found a way of setting a recursive folder search in Visual Studio (though Xcode has no problem setting and using them). What we do is list all the directories in a file, and specify the file in the C/C++ Command Line additional options:

@"IncludeFolders.rsp"

We rarely find problems using recursive search, though an accidental inclusion of ``/'' did slow things down a bit once.

David Sykes