יום ראשון, 27 באוקטובר 2013

LNK1123 error when bulding VC++ 2010 project after installing Visual Studio 2012 or .NET Framework 4.5

Problem:
When trying to build a program in Visual Studio 2010 receive an error:


Error      1              error LNK1123: failure during conversion to COFF: file invalid or corrupt                C:\Users\username\documents\visual studio 2010\Projects\nameOfProject\cpp\LINK  cpp

Analyze:
The problem started after installing .NET Framework 4.5
According to Microsoft the issue is caused by a dependency failure of cvtres.exe on msvcr100_clr0400.dll which is shipped with Visual Studio 2010 RTM and eventually updated with a new version when Visual Studio 2012 RTM or .NET Framework 4.5 is installed. 




Resolution:


  • Either disable incremental linking, by going to
    Project Properties
       -> Configuration Properties
           -> Linker (General)
             -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"


  •        or install VS2010 SP1 from Microsoft website:
               http://www.microsoft.com/en-us/download/details.aspx?id=23691







אין תגובות:

הוסף רשומת תגובה