转自:http://blog.csdn.net/junjiehe/article/details/16888197
采用红字方法可行
LinkIssue: Error ‘LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or cor
使用VisualStudio 编译链接中可能出现如下错误:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
网上有如下解决方法:
1. disable incremental linking
Project Properties
-> Configuration Properties
-> Linker (General)
-> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
2. turning off "Embed Manifest"
但是我使用这两种方法均不奏效.
Issue root cause: 系统更新或软件升级中,造成有多于一个版本的 Utility: cvtres.exe
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe
而因不当造成VS目录下的cvtres.exe不在work.如果该Utinity在路径的前面,linker觉得需要转换一个.res文件为COFF对象格式,link将失败,显示error: LNK1123
方法: 对VS下旧的Utility cvtres.exe删除或者重命名.或者重新安排 PATH 变量.
参考文献:
http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval
Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or cor