LNK1123: failure during conversion to COFF: file invalid or corrupt
鏈接器調用 cvtres.exe 將資源文件轉換為 COFF 格式。系統中存在多個版本的 cvtres.exe(如 .NET Framework、VS 自帶、Windows SDK),版本不匹配導致轉換失敗。
dir /s /b cvtres.exe
# 典型路徑:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe # VS2010 自帶
C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe # .NET 4.0
C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_...\cvtres.exe # WinSxS 存儲
cvtres.exe實測:用 WinSxS 版本覆蓋 VS2010 目錄下文件即可解決。
cvtres.exe 負責 .res → .obj (COFF) 轉換rc.exe、mt.exe 等工具衝突StackOverflow 高票回答:LNK1123 詳細分析