LinkIssue: Error ‘LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or cor

The following error may occur in compiling the link with VisualStudio:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
The following solutions are available online:
1. Disable incremental linking
 

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

2. Turn off “Embed Manifest”
 
 
But neither method worked for me.
Issue root cause: In a system update or software upgrade, there is more than one version of the Utility: Cvtres.exe
D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
C:\Windows\Microsoft.NET \ Framework \ v4.0.30319 \ cvtres exe


Cvtres. exe in VS directory is not in work due to improper cause of . If the Utinity is in front of the path and linker feels the need to convert a.res file to COFF object format,link will fail, showing error: LNK1123

: delete or rename the old Utility cvtres.exe to cvtres.exe_old for VS. Or rearrange the PATH variable.

reference :

http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval
-------------------
 
About Error: LNK1123: Failure during conversion to COFF: File invalid or corrupt error solution [Qt] [VS2010]
 
VS2010 Qt development tools have had to be reinstalled due to a new hard drive. There is no problem with the installation process. After installation, I clicked on an example to test it and it did not work well. Then the error message in the title appeared. I had dealt with it once before, but I forgot it after a long time, so I solved it by another search. This time grow a heart eye, write down, lest later forget again (write blog essay of what not stick to, have to despise oneself).


 
Let's get started. The prompt indicates that the conversion to the COFF file failed because of an error (VS2010 is installed and there would normally be no file invalid).
Cvtres.exe is the program that does the conversion. The root cause of the above error is the presence of multiple versions of CVtres.exe on the system.
\Windows\Microsoft \Framework\v4.0.30319\cvtres.exe

VS directory version :C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe
if it is a 64-bit system, then there is another one in c: \Windows\Microsoft t.net \Framework64\v4.0.30319\cvtres.exe
, however, both versions of the Framework and Framework64 are the same, and are generally newer than the version in the VS directory due to system updates.


 

 


 
The solution here is obviously simple, just rename or delete the old version, but I usually do renames, like adding -old.
Another point to make is that when looking for the cvtres.exe program in the system directory, there is an XML file called Cvtres.exe (the blogger does not show the file extension). So don't make a mistake when you look for it.
Well, that's all for this essay. It's not easy to get into the habit of blogging T T, keep up the good work!

Reproduced in: https://www.cnblogs.com/kungfupanda/p/4121059.html

Read More: