Visual Studio 默认路径的修改

来源:互联网 发布:物美价廉的淘宝女装店 编辑:程序博客网 时间:2024/06/05 05:00

方法一

1.新建VS2010项目,然后在新建的项目的最下面找到“属性管理器(property manager)”选项

选择“microsoft.cpp.win32.user”这一项(debug或release的都行),在出来的属性框内选择“VC++目录(VC++ Directories)”,然后在“包含目录(include directories)”和“库目录(library directories)”中添加你的头文件路径和库文件路径


方法二

可以直接修改 C:\Users\lenovo\AppData\Local\Microsoft\MSBuild\v4.0 目录下的文件:Microsoft.Cpp.Win32.user 或者是Microsoft.Cpp.X64.user
比如 原来内容为:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
<IncludePath>$(IncludePath)</IncludePath>
<ReferencePath>$(ReferencePath)</ReferencePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
<SourcePath>$(SourcePath)</SourcePath>
<ExcludePath>$(ExcludePath)</ExcludePath>
</PropertyGroup>
</Project>

我现在需要增加一个目录:
C:\Boost\include\boost-1_43\;到默认头Include 路径,则可以修改文件如下:


<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
<IncludePath>C:\Boost\include\boost-1_43\;$(IncludePath)</IncludePath>
<ReferencePath>$(ReferencePath)</ReferencePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
<SourcePath>$(SourcePath)</SourcePath>
<ExcludePath>$(ExcludePath)</ExcludePath>
</PropertyGroup>
</Project>


XP系统的话修改C:\Program Files\Microsoft Visual Studio 10.0\VC\VCWizards中的default工程即可,修改后新建的工程都会有效,但对以前的工程无效,如果想要适用于以前工程,参加别人博客http://www.cnblogs.com/hwangbae/archive/2012/06/24/2560463.html

原创粉丝点击