Quantcast
Viewing latest article 10
Browse Latest Browse All 16

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt after installing VS2012 release preview

I’ve installed VS2012 Release Preview, and it appears to be fine, but now when I try to use VS2010 to compile C++ projects, I get the following error message:

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

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

I’ve tried repairing VS2010 from Add/Remove programs and rebooting, but this has no effect.

I also get the same error if I use VS2012 RC to compile the C++ projects when set to use the VS2010 toolset. Upgrading to the VS11 toolset fixes the problem (but of course I don’t want to do this for production code)

Update: I’ve uninstalled VS2012, rebooted, and the problem still persists! Help!


Solution:

This MSDN thread explains how to fix it.

To summarize:

  • Either disable incremental linking, by going to

    Project Properties 
       -> Configuration Properties 
           -> Linker (General) 
              -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
    
  • or install VS2010 SP1.

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

This affects Microsoft Windows SDK 7.1 for Windows 7 and .NET 4.0 as well as Visual Studio 2010.


Viewing latest article 10
Browse Latest Browse All 16

Trending Articles