vs2010及后续版本的相关目录

转载自:http://blog.csdn.net/u010476094/article/details/12884697

VC++2010项目属性设置有很多,如果有什么不明白的,单击选择项目属性窗口的某一项设置,按F1(或者单击窗口的帮助按钮),就可以在msdn上看到相关解释了(使用联机帮助的话)。本文的内容整理自msdn,先给出链接,这里只对(附加)包含目录,(附加)库目录进行总结。

 

“VC++目录”属性页

这里面有包含目录(Include Directories)、库目录Library Directories)等等,点开看看,里面有VC安装目录、Windows SDK目录、.NET Framework目录,是VC++默认设置好的。对于额外的头文件、库文件,我都在“附加包含目录”、“附加库目录+附加依赖项”处指定(见下文)。

 

 

"C/C++"

/I(附加包含目录) 指定(第三方的)头文件的目录

附加包含目录(Additional Include Directories)(/I ) :Adds a directory to the list of directories searched for include files.

To add more than one directory, use this option more than once.Directories are searched only until the specified include file is found.

You can use this option with the Ignore Standard Include Paths(/X (Ignore Standard Include Paths))option.

 

附加包含目录 与 “VC++目录”的“包含目录” 的关系如下:

The compiler searches for directories in the following order:

  1. Directories containing the source file.

  2. Directories specified withthe/I option(即附加包含目录), in the order that CL (编译器cl.exe)encounters them.

  3. Directories specified in the INCLUDE environment variable(即“VC++目录”的“包含目录” ‘Include Directories’).

有关“C/C++ -> 代码生成 -> 运行时库”的内容请参考这里

Choosing the Correct C/C++ Runtime Library

 

“链接器”

/LIBPATH附加库目录 .lib file的所在目录,

与“VC++目录”的“库目录”的关系如下:

附加库目录(Additional Libpath)(/LIBPATH) :Specifies a path that the linker will search before it searches the path specified in theLIB environment(即“VC++目录”的“库目录” ‘Library Directories’) option.

Use the /LIBPATH option to override the environment library path.The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable(即“VC++目录”的“库目录” ‘Library Directories’).

 

 

附加依赖项:指定要添加到链接命令行的附加项(.lib file的名字)。

你可能感兴趣的:(vs2010及后续版本的相关目录)