用VS2010编译C++项目时出现这样的错误:

LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 

解决方法:

1、搜索C盘下的cvtres.exe,结果得到类似这样的列表:

C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7601.17514_none_ba1c770af0b2031b
C:\Windows\Microsoft.NET\Framework\v4.0.30319

2、先备份 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下的 cvtres.exe

3、复制 C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7601.17514_none_ba1c770af0b2031b 目录下的 cvtres.exe 到C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下,直接覆盖替换。

4、OK,打开测试一下,如果不行,记得还原备份的文件。

相关文章:

  • 2022-12-23
  • 2021-08-31
  • 2022-01-08
  • 2022-12-23
  • 2021-04-28
  • 2022-02-18
猜你喜欢
  • 2021-12-31
  • 2021-06-17
相关资源
相似解决方案