(Microsoft VC++ Express)LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

f:id:xuechui:20170318081909p:plain

There are several "cvtres.exe" in C disk, maybe installed by .NET Framework. Replace the old one in VC/bin by the first one(new?) in C disk.

f:id:xuechui:20170318081918p:plain

连接器LNK是通过调用cvtres.exe完成文件向coff格式的转换的,所以出现这种错误的原因就是cvtres.exe出现了问题。

 

在电脑里面搜索一下cvtres.exe,发现存在多个文件,使用最新的cvtres.exe替换老的文件即可,替换之前记得备份一下,如果不对,可以替换回来。


例如:我的电脑里面安装了vs2010,最近更新了系统,打了一些补丁,结果就出现这种错误了。在电脑里面搜索发现

C:\Program Files\Microsoft Visual Studio 10.0\VC\bin

C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7600.16385_none_ba476986f05abc65

C:\Windows\Microsoft.NET\Framework\v4.0.30319


这三个路径里面都有cvtres.exe文件,于是我尝试使用第二个路径里面的文件替换第一个路径的文件,问题解决。


参考资料如下:

http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c/14144713#14144713

blog.chinaunix.net

blog.csdn.net