1. 程式人生 > >VS2015找不到stdio.h或new.h的Bug修復

VS2015找不到stdio.h或new.h的Bug修復

    今天嘗試安裝了VS2015,發現微軟還是沒有處理好一臺計算機安裝多個VS版本時環境配置問題。無論是建立Console控制檯程式還是MFC程式,都提示缺少"stdio.h"或"new.h"標頭檔案。VS工程預設的包含路徑C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include下的確沒有這些標頭檔案,那麼應該怎麼辦呢,難道需要手動從別處拷貝缺少的檔案嗎?後來搜尋了一下發現,微軟悄悄將這幾個標頭檔案挪到了C:\Program Files (x86)\Windows Kits\10\Include\中了。


VS2012找不到SDKDDKVer.h的Bug修復

    此前寫過一篇關於VS2012路徑設定的類似文章,VS2015的解決方法還是類似:開啟C:\Users\me>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props 檔案,在該檔案中新增分別向<IncludePath>欄位新增$(UniversalCRT_IncludePath)和向<LibraryPath>中新增$(UniversalCRT_LibraryPath_x86)。應網友要求將修改後的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>
    <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);$(FrameworkSDKDir)\include</IncludePath>
    <LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(WindowsSDK_LibraryPath_x86);$(UniversalCRT_LibraryPath_x86);$(FrameworkSDKDir)\lib</LibraryPath>
  </PropertyGroup>
</Project>