c++ - Visual Studio 2010 专业版 : Cannot find include file "new.h"

标签 c++ visual-studio-2010 visual-studio

所以我刚刚获得了 Visual Studio 2010 Professional,我创建了一个简单的 mfc 应用程序,添加了一些代码并且没有更改任何项目设置。当我尝试编译它时,我得到了这个错误:

1>------ Build started: Project: cadmenu, Configuration: Release Win32 ------
1>Build started 10/15/2013 3:44:26 PM.
1>InitializeBuildStatus:
1>  Touching "Release\cadmenu.unsuccessfulbuild".
1>ClCompile:
1>  stdafx.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(54):  fatal error C1083: Cannot open include file: 'new.h': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.06
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如果我创建一个新的 mfc 应用程序并且不添加任何代码,也会发生这种情况。我搜遍了整台电脑,没有new.h。

我知道这是因为 new.h 文件不在包含目录中,但这没有任何意义,因为我刚刚完成了 Visual Studio 2010 Professional 的完整安装。我尝试卸载,删除所有 Visual Studio 文件,然后重新安装,但问题仍然存在。谁能告诉我发生了什么,我该如何解决?非常感谢!


我在 64 位计算机上使用 Windows 8。我整天都在谷歌上搜索这个问题,但没有好的结果。

最佳答案

我刚刚安装了 VS2015 并且遇到了同样的问题。似乎 new.h 曾经位于 VC 文件夹中(例如 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include),现在位于 SDK 文件夹中(例如 C:\Program Files (x86)\Windows 工具包\10\Include\10.0.10150.0\ucrt)。如果你将它包含在你的包含文件夹列表中,它将编译过去。

enter image description here

关于c++ - Visual Studio 2010 专业版 : Cannot find include file "new.h",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19390873/

相关文章:

.net - 在 VS2012 中找不到 Microsoft.Office.Interop 程序集

c# - 统一: Visual Studio loses DLL reference after Unity compiles code

c++ - 从字符串中的多个数字中删除前导零? [C++]

c++ - 可以改善我的字符串拆分功能的建议

c++ - 使用 system() 执行后台进程

c# - 获取异常 "not all code path return a value"

c# - Visual Studio XNA 4.0 Refresh - 创建新项目和打开现有项目时出现问题

c# - 执行带有日期的 SQL Where 语句时出现的问题

c# - 如何在c#中保存和加载textBox字体?

c++ - 只需要知道我在c++中打印模式的方式是否有效,或者还有另一种方式可以有效地进行打印