安装 Visual Studio 2012 Release Preview 后出现错误“链接:致命错误 LNK1123:转换为 COFF 期间失败:文件无效或损坏" [英] Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt' after installing Visual Studio 2012 Release Preview

查看:35
本文介绍了安装 Visual Studio 2012 Release Preview 后出现错误“链接:致命错误 LNK1123:转换为 COFF 期间失败:文件无效或损坏"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Visual Studio 2012 Release Preview,它看起来没问题,但是现在当我尝试使用 Visual Studio 2010 编译 C++ 项目时,我收到以下错误消息:

I've installed Visual Studio 2012 Release Preview, and it appears to be fine, but now when I try to use Visual Studio 2010 to compile C++ projects, I get the following error message:

LINK:致命错误 LNK1123:转换为 COFF 时失败:文件无效或损坏

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

我不是 100% 确定这一点,但它似乎与包含 .rc(资源)文件的项目有关.

I'm not 100% sure of this, but it seems to be related to projects that have .rc (resource) files in them.

我尝试通过添加/删除程序修复 Visual Studio 2010 并重新启动,但这没有效果.

I've tried repairing Visual Studio 2010 from Add/Remove programs and rebooting, but this has no effect.

如果我在设置为使用 Visual Studio 2010 工具集时使用 Visual Studio 2012 RC 编译 C++ 项目,我也会遇到同样的错误.升级到 Visual Studio 2011 工具集解决了这个问题(但我当然不想对生产代码这样做).

I also get the same error if I use Visual Studio 2012 RC to compile the C++ projects when set to use the Visual Studio 2010 toolset. Upgrading to the Visual Studio 2011 toolset fixes the problem (but of course I don't want to do this for production code).

更新:我已卸载 Visual Studio 2012,重新启动,但问题仍然存在!帮助!

Update: I've uninstalled Visual Studio 2012, rebooted, and the problem still persists! Help!

推荐答案

这个 MSDN 线程 解释了如何修复它.

总结:

  • 要么禁用增量链接,转至

  • Either disable incremental linking, by going to

Project Properties 
   -> Configuration Properties 
       -> Linker (General) 
          -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

  • 或安装 VS2010 SP1.

  • or install VS2010 SP1.

    编辑 (@CraigRinger):请注意,安装 VS 2010 SP1 将删除 64 位编译器.您需要安装 VS 2010 SP1 编译器包 将它们取回.

    Edits (@CraigRinger): Note that installing VS 2010 SP1 will remove the 64-bit compilers. You need to install the VS 2010 SP1 compiler pack to get them back.

    这会影响 Microsoft Windows SDK 7.1 for Windows 7 和 .NET 4.0 以及 Visual Studio 2010.

    这篇关于安装 Visual Studio 2012 Release Preview 后出现错误“链接:致命错误 LNK1123:转换为 COFF 期间失败:文件无效或损坏"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆