Fatal error LNK1123: failed during COFF conversion: The file is invalid or corrupt, lnk1123coff

Source: Internet
Author: User

Fatal error LNK1123: failed during COFF conversion: The file is invalid or corrupt, lnk1123coff

To complete the instructor's task, use c ++ to write a calculator and learn more about c ++. Various problems arise in the result, such as the question.

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

Thanks to this Eldest Brother's post for solving this problem.

 

Vs2010> LINK: fatal error LNK1123: failed during COFF conversion: Invalid or corrupt file

> LINK: fatal error LNK1123: failed during COFF conversion: Invalid or corrupt file

Problem description: After VS2012 is installed, the original. NET 4.0 will be replaced with. NET 4.5. When VS2012 is uninstalled,. NET 4.0 is not restored.

  • L after vs2012is installed, cvtres.exe of vs2010cannot be used. If the first tool PATH in VS2010 appears in your PATH environment variable and the linker needs to convert the. res file to the COFF object format, the LNK1123 error will occur.
  • L when vsgenerates the pefile header, the cvtres.exe version used is incorrect and cannot be compatible with the current. NET platform.

Solution:

Refer:

Http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c

This is the result of the cvtres.exe.exe error. This problem can be solved in any way that enables the vschainer to find the corresponding cvtres.exe version. Alternatively, you can use VS linker methods that do not generate COFF.

Method 1]

Two cvtres.exe files exist in the system. The versions are different. Use the. NET 4.5cvtres.exe program in VS2010.

Procedure:

Rename or delete: (location where vs2010 is installed) C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ VC \ bin \ cvtres.exe

C: \ Windows \ Microsoft. NET \ Framework \ v4.0.30319 (the cvtres.exe file in. NET 4.58.0 can be used by VS2010.

Method 2]

The solution is as follows:
Project \ properties \ configuration properties \ Configuration tool \ Input and Output \ embedded list: changed from "yes" to "no ".

Note: This method requires Configuration Modification for each project.

Method 3]

Install: VS2010 SP1. this version should be. NET 4.5and be compatible with the latest version of cvtres.exe.

Note: The 64-bit compiler will be removed when VS 2010 SP1 is installed. You can obtain it again by installing the VS 2010 SP1 compiler pack.

Method 4]

Uninstall. NET 4.5 and reinstall. NET 4.0.

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.