Link:fatal error LNK1123 Occurs when vs2010 generates an EXE file for C + +: Failed and environment variable issues during transition to COFF

Source: Internet
Author: User

Somehow compiled a good VS2010 environment, suddenly "transition to COFF during the failure: invalid or corrupt file" link error. Spent a lot of days, tried a lot of methods, and finally solved the problem.
Now, let's list some of these solutions:
Scenario 1:
Click "Project"-"Properties"-"Inventory Tool"
Then select ' Input and Output '--' embed list ' and change the ' yes ' back to ' no '.
Scenario 2: Search Cvtres.exe in VS installation directory
Found there are two cvtres.exe files, some users choose to use the latest files to cover all the old Cvtres.exe,
Also has the Netizen is deletes the old Cvtres.exe the file. I changed the name of the old Cvtres.exe to restore the environment.
Note that these two files are a version number, but the generation time is only 1 hours apart, select the latest one.
There are a lot of cvtres.exe, this is not clear, try how to delete these files.
My two files directory is as follows:
D:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin\amd64
D:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin
Scenario 3: Installing a new VS2010 SP1 can also solve some of these problems.
The trouble is that the SP1 is still relatively large, messy things have to patch up.

Here is I found from Baidu, link https://zhidao.baidu.com/question/1493935034926540979.html This really solves my problem so I want to save it in the blog and share it with you.

And here are the configuration environment variables:

Configuration of the VS2010 environment variable:

As far as I can find on the Internet, VS2010 is unable to create a separate C/+ + file as in VS6.0, which undoubtedly caused great distress to beginners like me, and VS2010 superior to VS6.0 beauty makes us not bear to abandon it. In the case of a beginner in C + +, a single file can be debugged much more than the project is created. I was just wondering if I could configure the environment variable like Java to be able to compile C + + files with the command line? Looking for a long time on the network, patchwork and finally found the appropriate configuration method, although the command line to compile C or C + + files is not the only way, but I still find a way to use the excitement. Well, here's what needs to be configured.

Forget, would like to say how I step by step groping, or forget it, the direct start of the focus, nonsense more bad ~

Right-click on "Computer", properties, environment variables. You can be in the user or the system configuration, as you, I am a personal computer, so I configured the user.

1. Click "New" in the above user, variable name: PATH variable value: D:\Program Files\Microsoft Visual Studio 10.0\vc\bin; Be careful not to add spaces, plus a semicolon in English to differentiate the location, which is the established rule for environment variables. Well, this time you try to compile, Will warn you that the system is missing Mspdb100.dll file, let you re-install VS, this time if you really go to re-install it is tragic, because you will find that wasted so much time, or will appear this situation, you suspect your system problem then I really do not know what to say ~ ~ this time, You go see D:\Program. Files\Microsoft Visual Studio 10.0\Common7\IDE This directory, you should have the DLL link library that you have missing. There are two ways to do this, either copy the Mspdb100.dll file from D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE to D:\Program Files\Microsoft Visual Studio 10.0\vc\bin, or D:\Program Files\Microsoft Visual Studio 10.0\vc\bin in the environment variable path, plus D:\Program files\ Microsoft Visual Studio 10.0\Common7\IDE; This path is well-configured!

2. The problems that occur after the above steps have been completed I will not say that should include the file. Create another environment variable, variable name: Include variable value: D:\Program Files\Microsoft Visual Studio 10.0\vc\include; This step is OK.

3. New variable, variable name: lib Variable value: D:\Program Files\Microsoft Visual Studio 10.0\vc\lib; This time found still lack of things, it is best to go down to the system disk to find C:\Program Files\Microsoft Sdks\windows\v7.0a\lib,ok, the path is also copied to the value of the LIB variable C:\Program files\ Microsoft Sdks\windows\v7.0a\lib; Well, it's done!

OK, try it again, in the prompt command window to hit CL, enter, there will be the CL command prompt, according to the operation prompt can be used ~ This will not use every debug file in the VS2010 on the new project ~ Meet the big point of things to use it ~

Finally, we summarize some of the three variable configurations:

1. Variable Name: PATH variable Value: D:\Program Files\Microsoft Visual Studio 10.0\vc\bin;d:\program Files\Microsoft Visual Studio 10.0\ Common7\IDE;

2. Variable name: Include variable value: D:\Program Files\Microsoft Visual Studio 10.0\vc\include;

3. Variable name: lib Variable value: D:\Program Files\Microsoft Visual Studio 10.0\vc\lib; C:\Program Files\Microsoft Sdks\windows\v7.0a\lib;

This is also I search from the Internet, I didn't know VS2010 also to configure the environment variable, later saw this or operation a bit, feel should be useful, share to everyone, Link: http://blog.sina.com.cn/s/blog_7ea5cb4d0100xfce.html

Link:fatal error LNK1123 Occurs when vs2010 generates an EXE file for C + +: Failed and environment variable issues during transition to COFF

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.