>link:fatal Error LNK1123: Failed during transition to COFF: invalid or corrupt file
Issue Description: When VS2012 is installed, the original. NET 4.0 is replaced by. NET 4.5. When you uninstall VS2012,. NET 4.0 is not restored.
- When the VS2012 is installed, the VS2010 Cvtres.exe cannot be used. If the VS2010 tool path in your PATH environment variable appears first, and the linker needs to convert the. res file to the COFF object format, it will cause LNK1123 errors.
- When vs generates PE file headers, the Cvtres.exe version error is used and cannot be compatible with the current. NET platform.
Solution:
Reference:
Http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c
Because it is the result of a Cvtres.exe version error, the problem can be solved by any method that enables the VS linker to find the correct version of Cvtres.exe. Or you can make the VS linker not generate COFF methods.
"Method One"
There are two cvtres.exe files in the current system with different versions. Let VS2010 use the. NET 4.5 Cvtres.exe program.
Specific steps:
Rename or delete: (vs2010 installed location ) C:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin\cvtres.exe
This way, the Cvtres.exe file in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (. NET 4.5) can be used by VS2010.
"Method Two"
Here's how to fix it:
Project \ properties \ Configuration properties \ manifest tools \ input and output \ Embed list: The original is "yes" and changed to "no".
Description: This method requires the configuration to be modified for each project.
"Method Three"
Installation: VS2010 SP1. This version should be available in. NET 4.5 with the correct cvtres.exe version.
Note: The 64-bit compiler is removed when installing vs. SP1. Can be re-acquired by installing the VS. SP1 compiler Pack.
"Method Four"
Uninstalling. NET 4.5, reloading. NET 4.0
VS2010 problem >link:fatal Error LNK1123: Failed during transition to COFF: invalid or corrupt file