Thursday 30 January 2014

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


Causes:
This error appear because you have installed Visual C++ 2012 after you
have actually installed Visual C++ 2010 in your system;
another cause is because .net Framework 4.5 replace .net Framework 4.0;
.net Framework corrupted files;
 
How To Solve:
Solution 1:
Either disable incremental linking, by going to
Project Properties
   -> Configuration Properties
       -> Linker (General)
          -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

 
 
 
Solution 2:
If disabling incremental linking doesn't work for you, and turning off
"Embed Manifest" doesn't work either, then search your path for multiple
versions of CVTRES.exe.
 
By debugging with the /VERBOSE linker option I found the linker was
writing that error message when it tried to invoke cvtres and it failed.
It turned out that you had two versions of this utility in your path.
 
One at C:\Program Files\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.
(Really annoying that the error message has nothing to do with the
actual problem, but that's not unusual for a Microsoft product.)
 
Solution:
Just delete/rename the older version of the utility, or re-arrange your
PATH variable, so that the version that works comes first. I mostly use renamed the old version file.
 
Solution 3:
-> If Visual Studio 2012 RC and Visual Studio 2010 with SP1 are installed on the same computer then you will be re-install VS 2010 with SP1,
-> If you have Visual Studio 2012 RC  and Visual Studio 2010 then you will be install Visual Studio 2010 with SP1.
you can open the project in both of those versions of Visual Studio.
 
Solution 4:
Uninstall .Net Framework 4.5 from your system and re-install .Net Framework 4.0.

 
   

No comments: