打開 C:\Users\Administrator\AppData\Local\Microsoft\MSBuild\v4.0目錄中的 Microsoft.Cpp.Win32.user.props 文件(有三個,應該打開哪個看文件名便知),裏面內容一般如下
<?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>
分別在<PropertyGroup> 的<IncludePath>增添加包含目錄,在<LibraryPath>項中添加庫目錄,保存重啓VS即可。