无法安装 Visual Studio C++ 包含文件“excpt.h”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13656856/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't get visual studio C++ include file 'excpt.h' to get installed
提问by Christian O'Reilly
I'm trying to compile a visual studio C++ project and I can't get anywhere because of the compiler reporting "Cannot open include file: 'excpt.h': No such file or directory". The problem has been reported numerous times on the Internet but I can't find any help regarding my particular situation. The problem is not that the include path of the project are not correctly setup, the problem is that this include file (and probably a bunch of other files) are just missing from my computer. There is no such file on my hard drive. So I tried installing Windows SDK 7.1. The file is not inside the installed SDK (although it should be). I tried repairing the install, uninstall it, reinstall it... all numerous time. I also try to install, repair, uninstall, reinstall Visual Studio 2010 professional numerous time, with and without the Windows SDK installed. I even tried uninstalling the professional version to install the express VC++... nothing seems to work, no 'excpt.h' never get installed on my computer. I am clueless... someone has a hint of a solution? I'm on Windows 7.
我正在尝试编译 Visual Studio C++ 项目,但由于编译器报告“无法打开包含文件:'excpt.h':没有这样的文件或目录”,我无法到达任何地方。该问题已在 Internet 上多次报告,但我无法找到有关我的特定情况的任何帮助。问题不在于项目的包含路径设置不正确,问题在于我的计算机中缺少此包含文件(可能还有一堆其他文件)。我的硬盘上没有这样的文件。所以我尝试安装 Windows SDK 7.1。该文件不在已安装的 SDK 中(尽管应该在)。我尝试修复安装,卸载它,重新安装它......所有很多次。我也多次尝试安装、修复、卸载、重新安装 Visual Studio 2010 Professional,安装和未安装 Windows SDK。我什至尝试卸载专业版来安装 express VC++...似乎没有任何效果,我的计算机上从未安装过“excpt.h”。我一无所知......有人有解决方案的暗示吗?我在 Windows 7 上。
As supplementary information, note that 'excpt.h' is included in by "windows.h". Also, the "excpt.h" file is normally installed with the Windows SDK under a path like "c:\program files (x86)\microsoft sdks\windows\v7.1\include\" and with Visual Studio under a path like "C:\Program Files\Microsoft Visual Studio 10.0\VC\include\".
作为补充信息,请注意“excpt.h”包含在“windows.h”中。此外,“excpt.h”文件通常与 Windows SDK 一起安装在“c:\program files (x86)\microsoft sdks\windows\v7.1\include\”等路径下,Visual Studio 安装在类似路径下“C:\Program Files\Microsoft Visual Studio 10.0\VC\include\”。
EDIT: If it might help, I might add that the folder C:\Program Files\Microsoft Visual Studio 10.0\VC\include related my Visual Studio install has only two files... which is certainly not normal!!! However, I can't find any ways to get the installer to install all the .h files that should appear in this repertory.
编辑:如果它可能有帮助,我可能会添加文件夹 C:\Program Files\Microsoft Visual Studio 10.0\VC\include 相关我的 Visual Studio 安装只有两个文件......这当然不正常!!!但是,我找不到任何方法让安装程序安装所有应出现在此库中的 .h 文件。
采纳答案by Christian O'Reilly
For those who have the same problem, here is the solution I found after about 10h of install/uninstall/cleaning cycles... I've uninstalled completely visual studio using this. After that, using the control panel, I've uninstalled the Windows SDK and everything that can be associated with it or with visual studio (e.g. .NET framework). Then, I've removed all the left overs by manually deleting the visual studio and the Windows SDK folders located in C:/Program files. Finally, I deleted all the entries related to the Windows SDK or to Visual Studio in the registry (they are located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft). Then, I reinstalled Visual Studio... and it was finally working correctly. I should add that I restarted and cleaned the registry using CCleaner after any install or uninstall step.
对于那些有同样问题的人,这是我在大约 10 小时的安装/卸载/清理周期后找到的解决方案......我已经使用这个完全卸载了 Visual Studio 。之后,使用控制面板,我卸载了 Windows SDK 以及所有可以与之关联或与 Visual Studio(例如 .NET 框架)关联的东西。然后,我通过手动删除 Visual Studio 和位于 C:/Program 文件中的 Windows SDK 文件夹删除了所有剩余内容。最后,我删除了注册表中与 Windows SDK 或 Visual Studio 相关的所有条目(它们位于 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft)。然后,我重新安装了 Visual Studio ......它终于正常工作了。我应该补充一点,在任何安装或卸载步骤之后,我都使用 CCleaner 重新启动并清理了注册表。
回答by pmelanson
I had the same problem, and tried the answer given by OP, but it did not work. However, copying the contents of C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
(specifically bin, lib, and include) from a machine that did work to this machine worked.
我遇到了同样的问题,并尝试了 OP 给出的答案,但没有奏效。但是,将C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
(特别是 bin、lib 和 include)的内容从一台可以工作的机器复制到这台机器上是可行的。
回答by Jive Dadson
See if you have it at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h Check to be sure that the system include-paths are correct in Visual Studio. If all else fails, uninstall everything, all SDK's, etc., and re-install Visual C++.
查看您是否在 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h 中找到它,请检查以确保 Visual Studio 中的系统包含路径正确。如果所有其他方法都失败,请卸载所有内容、所有 SDK 等,然后重新安装 Visual C++。
Third party search programs do a better job than the Windows one for finding things. Try Agent Ransack. It's free.
第三方搜索程序比 Windows 搜索程序做得更好。试试特工 Ransack。免费。
回答by Phil Rosenberg
I had this problem with a project that had been updated to VS2017 from VS2015.
我在一个从 VS2015 更新到 VS2017 的项目中遇到了这个问题。
This was a header included via windows.h. I knew this header should have no problems as I had other projects created directly in VS2017 that used windows.h.
这是通过 windows.h 包含的标题。我知道这个标题应该没有问题,因为我在 VS2017 中直接创建了其他使用 windows.h 的项目。
Another symptom was that the intellisense was highlighting includes of standard headers (e.g string, vector etc), although these were not generating compile errors.
另一个症状是智能感知突出显示了标准头文件(例如字符串、向量等)的包含,尽管这些没有产生编译错误。
The fix for me was similar to VS 2010 Cannot open source file “string”.
对我的修复类似于VS 2010 无法打开源文件“字符串”。
Initially, I retargeted the project, hoping this would help (right-click the project, select retarget projects), but this did not in itself cure the problem.
最初,我重新定位了该项目,希望这会有所帮助(右键单击该项目,选择重新定位项目),但这本身并不能解决问题。
I then took a working project and copied the include directories from project properties->Configuration Properties->VC++ Directories and used these to replace the same property for my broken project. This fixed the problem.
然后我拿了一个工作项目并从项目属性-> 配置属性-> VC++ 目录复制包含目录,并使用这些来替换我损坏的项目的相同属性。这解决了问题。
Initially, the value for this property was
最初,此属性的值是
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);
The replacement value was
替换值为
$(VC_IncludePath);$(WindowsSDK_IncludePath);
回答by Milan Stezka
It seems the Visual Studio 2012 installer is buggy when it comes to installing into a different drive letter than C:. I have installed the VS2012 into the D: drive and got the same error. I found that for some unknown reason the installer put some of the files into the correct location at:
在安装到与 C: 不同的驱动器号时,Visual Studio 2012 安装程序似乎有问题。我已将 VS2012 安装到 D: 驱动器中并得到相同的错误。我发现由于某种未知原因,安装程序将一些文件放入了正确的位置:
D:\Program Files (x86)\Microsoft Visual Studio 11.0
D:\Program Files (x86)\Microsoft Visual Studio 11.0
but the remaining files were at
但剩下的文件在
C:\Program Files (x86)\Microsoft Visual Studio 11.0
C:\Program Files (x86)\Microsoft Visual Studio 11.0
so I have moved the files from the C: into the D: location and it fixed the problem.
所以我已将文件从 C: 移动到 D: 位置并解决了问题。
回答by Carl Walsh
Fixing your Visual Studio installation is a good idea, but you don't necessarily need to re-install the same old version of VS. I uninstalled VS 2015, then modified my VS 2017 installation to add the VC++ v140 build tools, and now my project builds.
修复您的 Visual Studio 安装是一个好主意,但您不一定需要重新安装相同的旧版本 VS。我卸载了 VS 2015,然后修改了我的 VS 2017 安装以添加 VC++ v140 构建工具,现在我的项目构建了。
回答by Muscolar
Some situation cause such problem. If you have uninstalled vs2010. you lost platform C++ binaries for .net framework 4 forever. You have to delete all of VS 2010 2012 2013, clean system up and its accompany components and reinstall them from scratch. Or you can download this package. Include them in your project that may solve your problem properly.
某些情况会导致此类问题。如果你已经卸载了 vs2010。你永远失去了 .net framework 4 的平台 C++ 二进制文件。您必须删除所有 VS 2010 2012 2013,清理系统及其附带组件,然后从头开始重新安装它们。或者你可以下载这个包。将它们包含在您的项目中,可以正确解决您的问题。
回答by chenlian
one simeple way,just copy vc directory(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC) from other computer
一种简单的方法,只需从其他计算机复制 vc 目录(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC)