Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt' after installing Visual Studio 2012 Release Preview

前端 未结 26 2326
误落风尘
误落风尘 2020-11-22 07:45

I\'ve installed Visual Studio 2012 Release Preview, and it appears to be fine, but now when I try to use Visual Studio 2010 to compile C++ projects, I get the following erro

相关标签:
26条回答
  • 2020-11-22 07:45

    If you're using x64, here's a resource will help:

    This happens because Microsoft .NET 4.5 is incompatible with Visual C++ 10. The workaround is to ensure that you run the .NET version of cvtres.exe rather than the Visual C++ version. I did this by renaming the Visual C++ versions of those files and copying the .NET versions in their place.

    1. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
    2. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cvtres.exe
    
    1. C:\windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe
    2. C:\windows\Microsoft.NET\Framework64\v4.0.30319\cvtres.exe
    
    0 讨论(0)
  • 2020-11-22 07:46

    My problem was that I've had two paths on my PC that contained the same libraries. Both paths were added to the Additional Library Directories in Configuration Properties -> Linker -> General. Removing one of the paths solved the problem.

    0 讨论(0)
  • 2020-11-22 07:47

    I solved this by doing the following:

    1. In a command prompt, type msconfig and press enter.
    2. Click services tab.
    3. Look for "Application Experience" and put tick mark (that is, select this to enable).
    4. Click OK. And restart if necessary.

    Thus the problem will go forever. Do build randomly and debug your C++ projects without any disturbance.

    0 讨论(0)
  • 2020-11-22 07:50

    As of January 2014, for some reasons I got installed .NET Framework 4.5.1, I don't know if due to a third party software installation or to an automatic update.

    On January 29th, I got installed one component and I started receiving the

    LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt 
    

    message. At that time, I solved by avoiding the incremental link.

    On Jan. 31st, I got installed another component of .NET Framework 4.5.1 and the incremental link trick did not work anymore. I then installed the Visual Studio 2010 SP1, but afterwards the problem became:

    Error   6   error LNK1104: cannot open file 'msvcrtd.lib'. 
    

    I think the SP1 messed up my Visual Studio 2010 installation.

    So I uninstalled .NET Framework 4.5.1, installed .NET Framework 4.0 and uninstalled and then reinstalled Visual Studio 2010. That worked for me.

    0 讨论(0)
  • It's because of .NET Framework 4.5 is replacing .NET Framework 4.0. I uninstalled Visual Studio 2010 several times with no luck. When I removed .NET Framework 4.5 and reinstalled Visual Studio 2010 it went fine.

    See Uninstall Visual Studio 11 completely to do a fresh install.

    0 讨论(0)
  • 2020-11-22 07:53

    Check the version of cvtrs.exe:

    dir "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe"
    

    Wrong version:
    date: 03/18/2010
    time: 01:16 PM
    size: 31,048 bytes
    name: cvtres.exe

    Correct version:
    date: 02/21/2011
    time: 06:03 PM
    size: 31,056 bytes
    name: cvtres.exe

    If you have wrong version you should copy the correct version from:

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
    

    and replace the one here:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
    

    i.e.

    copy "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe"
    
    0 讨论(0)
提交回复
热议问题