Fatal error lnk1123: failed during coff conversion: Invalid or corrupted file (embedded List)

Source: Internet
Author: User

When a vc6 program is converted to vs2005, the following error occurs: Fatal error lnk1123: failed during coff conversion: The file is invalid or damaged. The study found that the problem was caused by vs2005 listing file generation.


Vs2005 uses a new technology to generate an executable file. The executable file generated by this technology will generate a configuration file (manifest file )(. manifest suffix file) (which is essentially an XML document, you can open it in a text editor), and embed the list file into the EXE file after the link is complete (by default ).


In the FAT32 file system, when the configuration file is processed, the configuration file cannot be updated (by default) when the incremental link is used. As a result, the configuration file fails to be embedded, so that the EXE file fails to run without the corresponding list file and the above error is prompted.


There are many solutions, as shown below:

1. Because this is a problem with the link to the dynamic Runtime Library, you can select the connection method generated by the Code as/MTD rather than/MDD, without using these DLL files to avoid the problem. This method has a very obvious disadvantage: it has a limited scope of application, and it is not a solution I will advocate. It is not recommended.


2. Since it is related to the FAT32 system, we can choose to develop it in the NTFS file system to avoid this problem. This method is the same as above. It is also a way to avoid the problem and is not recommended.


3. this method is still related to FAT32: Select "yes" for "FAT32 solution" in "properties | configuration tools | General" of the project. The default value is "no "), regenerate the project to solve the problem. This method is the only solution to the problem, so that the inventory tool can be correctly updated. (This method is an official solution, which is convenient and recommended)


4. Since the problem occurs when the embedded inventory file is updated, the embedded inventory file cannot be updated due to FAT32, so we have two solutions:

4.1 do not enable incremental links. Select "no" for "enable incremental link" in "properties | configuration properties | linker | General" of the project ". This method blocks the source of the problem. Each time an EXE file is generated, the inventory file is directly embedded, instead of deciding whether to update the inventory file based on the timestamp by default.

4.2 do not embed the inventory file. In "properties | configuration tools | input and output" of the project, select "no" for "embedded list ", therefore, an inventory file is generated along with the generation of the EXE file (by default, the file name is the full name of the EXE file plus ". manifest ") to avoid the possibility of failure to embed the inventory file. This configuration file is used when the program runs. Obviously, this method generates more external dependencies for executable programs, which is not recommended.

5. there is another method that cannot be called a method: manually delete it before each build *. ILK file (incremental link file) (of course, you can write the DELETE command in the project property to make it run automatically), not recommended.


Finally, Let's sum up: this problem only appears under specific conditions: compile in the FAT32 file system, default settings (incremental mode, FAT32 solution not enabled, embedded inventory file), not the first generation into an executable file (that is, when the incremental connection, update the inventory file ).


Solution 4.1 and are convenient and practical, and are recommended for use.

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.