Benjamin

静以修身,俭以养德,非澹薄无以明志,非宁静无以致远。
随笔 - 388, 文章 - 0, 评论 - 196, 引用 - 0
数据加载中……

vs2013添加VC工程IncludePath、LibraryPath等路径的方法

Visual C++ 项目属性将定义在 %ProgramFiles(X86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms,该目录下有ARM、Win32、X64三个文件夹
根据需要或者分别修改三个文件夹下的PlatformToolsets\v120\Toolset工程属性文件,找到
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
这个是include路径,可以直接添加绝对路径或相对路径
如果需要修改LibraryPath静态库文件,找到
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);</LibraryPath>
直接添加绝对路径或相对路径
可更改路径还有SourcePath、ExcludePath,这里修改对所有工程都生效,无论是新建项目工程还是过去项目工程;
IncludePath的默认路径在C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Common中,
<VC_IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include</VC_IncludePath>;
VCInstallDir定义为<VCInstallDir>$(VCInstallDir_120)</VCInstallDir>
VCInstallDir_120定义为:
<VCInstallDir_120 Condition="'$(VCInstallDir_120)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC@ProductDir)</VCInstallDir_120>,可见这个定义是在安装的时候写入注册表的;
其他的VC编译器宏都可以在这个文件中找到最原始的定义,都是在安装vs的时候生成,写入注册表。

posted on 2016-02-20 17:55 Benjamin 阅读(5298) 评论(0)  编辑 收藏 引用 所属分类: VC


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理