Fatal error LNK1123: Failed during transition to COFF: invalid or corrupt file

Source: Internet
Author: User

To complete the task of the teacher, write a calculator in C + +, and learn some C + +, the result is a variety of problems, title

Http://www.cnblogs.com/newpanderking/articles/3372969.html

Thanks to this big Brother's post for me to solve the problem of the pit father

VS2010 problem >link:fatal Error LNK1123: Failed during transition to COFF: invalid or corrupt file

>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

Fatal error LNK1123: Failed during transition to COFF: invalid or corrupt file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.