VS2015找不到stdio.h或new.h的Bug修复
程序员文章站
2022-06-10 20:44:00
...
今天尝试安装了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" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<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>
<ItemDefinitionGroup />
<ItemGroup />
</Project>