修改 VS2010 项目属性的默认包含路径

来源:互联网 发布:路由器数据监控软件 编辑:程序博客网 时间:2024/05/29 07:36
Visual C++ 2010 中 “VC++目录”设置被移到了每个项目的项目属性上,这样每次新建一个DirectX的项目时,都需要在项目属性中添加DirectX的包含目录和库目录,重复做同样的事情实在不爽,其实可每次新建项目时默认包含该目录,方法:
打开 C:\Users\Administrator\AppData\Local\Microsoft\MSBuild\v4.0目录中的 Microsoft.Cpp.Win32.user.props 文件(有三个,应该打开哪个看文件名便知),里面内容一般如下

[html] view plaincopy
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  3.  <PropertyGroup>  
  4.    <ExecutablePath>$(ExecutablePath)</ExecutablePath>  
  5.    <IncludePath>$(IncludePath)</IncludePath>  
  6.    <ReferencePath>$(ReferencePath)</ReferencePath>  
  7.    <LibraryPath>$(LibraryPath)</LibraryPath>  
  8.    <SourcePath>$(SourcePath)</SourcePath>  
  9.    <ExcludePath>$(ExcludePath)</ExcludePath>  
  10.  </PropertyGroup>  
  11. </Project>  


分别在<PropertyGroup> 的<IncludePath>增添加包含目录,在<LibraryPath>项中添加库目录,保存重启VS即可。
原创粉丝点击