在我的项目的配置属性中,在VC++ 目录"下有一个包含目录"条目.但是在C/C++"选项下,还有一个条目叫做Additional Include Directories".库目录也会发生同样的事情.
In configuration properties of my project, under the "VC++ directories" there is an entry for "Include Directories". But under "C/C++" option, there is another entry called "Additional Include Directories". Same thing happens with library directories.
这两个条目有什么区别?
What are the difference between these two entries?
这是 VS2010 中引入的尴尬.VC++ 目录设置过去位于工具 + 选项、项目和解决方案、VC++ 目录中.应用于机器上构建的每个项目的全局设置.它仍然存在,但指出您现在应该在项目设置中更改它.VS2010 中构建引擎大修的副作用,支持使用 msbuild 进行构建.删除每个项目的设置是合乎逻辑的,但这会破坏太多现有项目.
This is awkwardness that got introduced in VS2010. The VC++ Directories settings used to be located in Tools + Options, Projects and Solutions, VC++ Directories. Global settings that applied to every project that was built on the machine. It is still there but points out that you should now change it in your project settings. A side-effect of the build engine overhaul in VS2010, enabling building with msbuild. Removing the per-project settings would have been logical but that would break too many existing projects.
因此,最好将 VC++ 目录设置视为机器默认设置.它由 VS 安装程序自动预设.仅当您需要不寻常的目录搜索顺序时才修改它,将自定义位置放在最后.这样做很不寻常.
As such, it is probably best to treat the VC++ Directories settings as the machine default. It is automatically preset by the VS installer. Tinker with it only if you need an unusual directory search order, putting the custom locations last. Very unusual to do so.
但是它确实有效.它最终确实被利用了.在 VS2012 及更高版本中增强平台工具集设置.不同的编译器,不同的链接器,不同的#include 目录,不同的链接器搜索路径.只修改了一个设置,不错.
It does work however. And it did get taken advantage of eventually. Empowering the Platform Toolset setting in VS2012 and up. Different compiler, different linker, different #include directories, different linker search path. Modified with just one setting, nice.
这篇关于“包含目录"和“包含目录"有什么区别?和“其他包含目录"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!