c++ - 'Windows.h : No such file or directory"error when changing Platform Toolset to v140_xp

标签 c++ visual-c++ visual-studio-2015 windows-xp

<分区>

我尝试为 Windows XP 编译一个应用程序;正常的可执行文件给出错误:

"... is not a valid Win32 application."

我读到我可以通过将平台工具集更改为 Visual Studio 2015 - Windows XP (v140_xp) 来创建与 XP 兼容的可执行文件,但是当我这样做然后尝试编译时,它给了我以下错误:

Cannot open include file: 'Windows.h': No such file or directory

Could not find WindowsSdkDir_71A variable from registry. TargetFrameWorkVersion or Platform toolset may be set to an invalid version number.

如何使用此工具集版本进行编译?

最佳答案

将平台工具集设置为 Visual Studio 2015 - Windows XP (v140_xp) 后,关闭 VS 2015 并重新打开项目。它会自动弹出一个窗口,告诉您安装一些文件以支持 Windows XP 项目。

关于c++ - 'Windows.h : No such file or directory"error when changing Platform Toolset to v140_xp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33035209/

相关文章:

c++ - 当另一个进程正在运行时,OpenMP 非常慢

c++11 - 错误 E0146 : Too many initializer values C++

visual-studio - Visual Studio 2008 不断重建

cordova - 当我尝试打开开发者工具时,Ripple 模拟器/Chrome 浏览器关闭

javascript - Cordova 为 Android 构建错误所以我无法构建我的解决方案

javascript - TypeScript:TypeError b 未定义

c++ - uint8_t 在转换为 unsigned int 时不打印正确的值

c++ - 将 GoogleMock 与 Boost::Shared Pointers 一起使用时泄漏的模拟对象

c++ - 是否建议不要将大型 STL 对象作为值存储到 std::unordered_map 中?

c++ - 如何使用 visual c++ 中的 strncpy_s 函数?