3 декабря 2013

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

After VS2012 is installed, VS2010 may fail with the LNK1123 in compiling some of old projects that were perfectly fine previously. This seems to have something to do with .NET framework 4.5 which comes with VS2012. To fix this problem, install VS2010 sp1. If it is not possible, try the following.

It turned out that I had two versions of this utility in my path. One at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe and one at C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe. After VS2012 install, the VS2010 version of cvtres.exe will no longer work. If that’s the first one in your path, and the linker decides it needs to convert a .res file to COFF object format, the link will fail with LNK1123. Just delete/rename the older version of the utility, or re-arrange your PATH variable, so that the version that works comes first. see the original post


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

Or Install VS2010 SP1:

 44 total views,  1 views today

Copyright 2020. All rights reserved.

Опубликовано Кирилл в категории "C#", "C++