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

前端 未结 26 2393
误落风尘
误落风尘 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:59

    +1 to user Short for an answer that worked for me!

    I tried to do some debugging of this with msbuild /v:diag, and I'm seeing that MSBuild is trying to embed a manifest in the executable, with <somename>.dll.embed.manifest.res on the linker command line, where that is a resource file built from <somename>.dll.embed.manifest. But the manifest file is an empty Unicode text file. (That is, a two-byte file with the Unicode 0xFEFF prefix)

    So the root problem seems to have something to do with that manifest file not being generated, or it being used when <somename>.dll.intermediate.manifest should have been used.

    An alternate solution seems to be to turn off the "Embed Manifest" option under Properties, Manifest Tool, Input and Output.

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

    Reinstalling CMake worked for me. The new copy of CMake figured out that it should use Visual Studio 11 instead of 10.

    0 讨论(0)
  • 2020-11-22 08:00

    This MSDN thread explains how to fix it.

    To summarize:

    • Either disable incremental linking, by going to

      Project Properties 
         -> Configuration Properties 
             -> Linker (General) 
                -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
      
    • or install VS2010 SP1.

    Edits (@CraigRinger): Note that installing VS 2010 SP1 will remove the 64-bit compilers. You need to install the VS 2010 SP1 compiler pack to get them back.

    This affects Microsoft Windows SDK 7.1 for Windows 7 and .NET 4.0 as well as Visual Studio 2010.

    0 讨论(0)
  • 2020-11-22 08:00

    If you have installed Visual Studio 2012 RC, then it installed .NET 4.5 RC.

    Uninstall .NET 4.5 RC, and install the version you need (4.0 for VS 2010). This should clear up any problems you are having.

    This solved the same problem. There is no need to uninstall Visual Studio.

    0 讨论(0)
  • 2020-11-22 08:01

    For me, setting 'Generate Manifest' to 'No' fixed it. (Also fixed with /INCREMENTAL:NO)

    0 讨论(0)
  • 2020-11-22 08:01

    Even inspite of installing Service pack you are getting the error then try removing/renaming the cvtres.exe in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin folder. This has worked for me.

    0 讨论(0)
提交回复
热议问题