8

I tried adding the include directories in the VC++ Directories -> Include Directories option in Tools -> Options but when compiling I get error - "Can't find file or directory" . Once I add to the Project properties -> Configuration properties -> C++ -> General -> Additional include directories , I could compile successfully.

So why does Visual Studio have a Include Directories option. Why is it used for ? (I'm using Visual studio 2010 Beta 1 )

  • Possible duplicate of [What is the difference between "Include Directories" and "Additional Include Directories"](http://stackoverflow.com/questions/6883276/what-is-the-difference-between-include-directories-and-additional-include-dir) – Martin Ba Jan 11 '16 at 14:16

4 Answers4

6

Visual Studio team recently explained differences of VS 2010 regarding include directories to earlier versions in their blog. You should find your answer here: http://blogs.msdn.com/vsproject/archive/2009/07/07/vc-directories.aspx

haffax
  • 5,898
  • 1
  • 32
  • 30
  • I've added the include directories in the Project settings -> VC++ Directories -> Include directories (here : http://blogs.msdn.com/photos/btyler/images/9812340/original.aspx), but even then I'm not able to compile unless I add it to the C++ -> General -> Additional include directories option that is just below the VC++ Directories ooption in the above image –  Jul 14 '09 at 10:00
  • The tools-menu option for include directories will be removed from VC in the final 2010 version. So this is probably a left-over in the Beta. I know your way works fine with Visual C++ 2008, but since they remove it, just use the new way of adding global include directories in that you add it to the root property sheet as shown in the blog post I linked. If the include directory is project specific, then keep in in your project properties. – haffax Jul 14 '09 at 10:17
  • Tools menu option is already removed. In the project properties window there are two ways of adding the include directories See the image in the blog link you gave 1.) VC++ Directories -> Include directories (as they have shown there) 2.) C/C++ (option just below the VC++ Directories option in the image) -> General -> additional Include directories If I do it like #1 ,its not working but #2 works –  Jul 14 '09 at 10:30
1

Include directory under tools is common for all projects. This is where your includes for the Windows SDK is listed which is almost used by all the projects. The include directory under C++ tab is specific to that project. This is where you list all your custom project include files.

msvcyc
  • 2,569
  • 4
  • 24
  • 30
0

I think you mean "VC++ Directories" in Tools->Options->Projects.

The directories listed here are visible in the entire VS environment (common to all projects). That is it consists of the path to use when searching for executable files while building a VC++ project. So ,

  • you cannot specify paths relative to the location of project files. One should avoid this option IMHO.

  • Listing the paths in project setting also makes it more configurable as these directiories are considered when compiling through command-line also. Most major projects have automated builds through command-line, so they would fail to build if the directories are not listed in the project properties.

Abhay
  • 7,092
  • 3
  • 36
  • 50
-1

http://msdn.microsoft.com/en-us/library/t8096eby(VS.100).aspx

Please refer to this document.

Jagannath
  • 3,995
  • 26
  • 30