简体   繁体   中英

What is the diff b/w Includes in VC++ Directories options and Additional include directories in C++ -> General in Visual Studio

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 )

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM