C++ Visual Studio 2013:CL.exe 退出,代码为 -1073741515
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22038660/
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
Visual Studio 2013: CL.exe exited with code -1073741515
提问by foxx1337
I have a freshWindows 8.1 Pro x64 install with a freshVisual Studio 2013 Pro. When trying to compile a project with Platform Toolset to Windows7.1SDKI'm getting
我有一个全新的Windows 8.1 Pro x64 安装和全新的Visual Studio 2013 Pro。当尝试使用 Platform Toolset 将项目编译为Windows7.1SDK 时,我得到了
Error 1 error MSB6006: "CL.exe" exited with code -1073741515. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets 57 5 MenuBrowser
I tried running the supplied "Windows SDK Configuration Tool" and besides getting an error about Visual Studio 2005 and 2008 not being installed I think it did its job.
我尝试运行提供的“Windows SDK 配置工具”,除了收到有关未安装 Visual Studio 2005 和 2008 的错误之外,我认为它完成了它的工作。
I tried manually editing the registry:
我尝试手动编辑注册表:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
where I manually put CurrentInstallFolder
as C:\Program Files\Microsoft SDKs\Windows\v7.1\
and CurrentVersion
as 7.1.7600.0.30514
. If I look at the project properties and click the different paths / variables in there -> more -> Macros, I can see that $(WindowsSdkDir) is correct.
我手动把CurrentInstallFolder
asC:\Program Files\Microsoft SDKs\Windows\v7.1\
和CurrentVersion
as放在那里7.1.7600.0.30514
。如果我查看项目属性并单击其中的不同路径/变量 -> 更多 -> 宏,我可以看到 $(WindowsSdkDir) 是正确的。
Any idea as to what I should try? Never ran into this problem on the old development computer with Windows 7 and VS 2012.
知道我应该尝试什么吗?从未在装有 Windows 7 和 VS 2012 的旧开发计算机上遇到此问题。
L.E. as a note, if I try a new project with the v120 tools, it works, but I need the Windows7.1SDK tools.
LE 作为注释,如果我使用 v120 工具尝试一个新项目,它可以工作,但我需要 Windows7.1SDK 工具。
采纳答案by Hans Passant
When trying to compile a project with Platform Toolset to Windows7.1SDK...
尝试使用 Platform Toolset 将项目编译为 Windows7.1SDK 时...
That's not a valid selection in a "fresh" install for VS2013. Not very clear what you've been doing, it certainly isn't "fresh" anymore. Do treat Regedit.exe as a loaded weapon, the registry key set that configures VS has been getting pretty doggone convoluted as of late.
在 VS2013 的“全新”安装中,这不是一个有效的选择。不太清楚你一直在做什么,它肯定不再“新鲜”了。请务必将 Regedit.exe 视为已加载的武器,配置 VS 的注册表项集最近变得非常复杂。
The compiler crashes with -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND. That's a pretty serious mishap of course, it should neveroccur when you target SDK 7.1 since that still uses the same compiler, only the SDK directory is changed. The compiler itself, as well as the DLLs it uses, are not part of the SDK and only are provided if the machine doesn't have VS installed. You can use SysInternals' Process Monitor to diagnose this, you'll see the CL.EXE process searching for a DLL and not finding it.
编译器崩溃 -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND。这当然是一个相当严重的事故,它应该永远当你的目标SDK 7.1,因为这仍然使用相同的编译器,只有SDK目录改变发生。编译器本身以及它使用的 DLL 不是 SDK 的一部分,只有在机器没有安装 VS 时才提供。您可以使用 SysInternals 的 Process Monitor 进行诊断,您将看到 CL.EXE 进程正在搜索 DLL 而没有找到它。
The correctway to target 7.1 is to use the v120_xp toolset selection. That builds programs that can still run on XP, it automatically also selects the 7.1A SDK that was installed on your machine. Do try to undo the changes you've made.
以 7.1 为目标的正确方法是使用 v120_xp 工具集选择。它构建的程序仍然可以在 XP 上运行,它还会自动选择安装在您机器上的 7.1A SDK。请尝试撤消您所做的更改。
回答by Kai Schubert
Referencing Yodans solution from How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?:
从How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK 中引用 Yodans 解决方案 ?:
As pointed out by Hans Passant cl.exe looks for mspdb100.dll (among others) and does not find them. The needed files are in the directory mentioned in 7. below:
正如 Hans Passant cl.exe 所指出的那样,查找 mspdb100.dll(以及其他)并没有找到它们。需要的文件在下面7.中提到的目录中:
My working setup:
我的工作设置:
- VS2013 needs to use VS2010 libs
- Using WinSDK 7.1 build tools (v100) in VS2013
- clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279under category Details)
- Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
- Application Verifier
- Debugging Tools for Windows
- Windows Performance Toolkit
- Microsoft Help Viewer 1.0
- Microsoft Visual C++ 2010 Redistributable
- Microsoft Visual C++ 2010 Standard Edition
- Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
- choosing Windows7.1SDK as Platform Toolset in VS2013
- error MSB6006: "CL.exe" exited with code -1073741515
- cl.exe looks for one of msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
- Added to PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
- Build works and binary is usable!
- VS2013 需要使用 VS2010 的库
- 在 VS2013 中使用 WinSDK 7.1 构建工具 (v100)
- 干净安装,卸载 sdk 发行说明中提到的所有内容(可以在http://www.microsoft.com/en-us/download/details.aspx?id=8279下的类别详细信息下载)
- 适用于 Windows 7 (7.1) 的 Microsoft Windows SDK(Windows SDK 核心组件文件)
- 应用验证器
- Windows 调试工具
- Windows 性能工具包
- 微软帮助查看器 1.0
- Microsoft Visual C++ 2010 可再发行组件
- Microsoft Visual C++ 2010 标准版
- 另外删除了所有 .NET 和 VC++ 相关的 MS 软件(如有必要,未测试)
- 在VS2013中选择Windows7.1SDK作为平台工具集
- 错误 MSB6006:“CL.exe”退出,代码为 -1073741515
- cl.exe 查找 msobj100.dll、mspdb100.dll、mspdbcore.dll 和 mspdbsrv.exe 之一
- 添加到路径:C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
- 构建有效,二进制文件可用!
A mistake I did:
我犯的一个错误:
- copied files in 6. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin, believing this directory is in PATH, but it was not!
- So better do as sugested in 7. above or by Yodan in How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?
- 将上面 6. 中的文件复制到 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin,认为该目录在 PATH 中,但事实并非如此!
- 所以最好按照上面的 7. 或 Yodan 在How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK 中推荐的那样做?
回答by Pabitra Dash
The following steps work for me in VS 2017.
以下步骤在 VS 2017 中对我有用。
1.Close VS 2017. 2.Restart machine. 3.Open solution in VS 2017. 4.Build the project. This time I didn't get following error and it builds successfully.
1.关闭VS 2017。2.重启机器。3.在VS 2017中打开解决方案。 4.构建项目。这次我没有收到以下错误并且它成功构建。
error msb6006 "link.exe" exited with code -1073741819.
错误 msb6006“link.exe”退出,代码为 -1073741819。