Visual studio 2010出现“error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”解决方式

简介:

本来自己的电脑上装了VS2010,因为开发Cocos2d-x 3.x,所以就在自己的机器上装了一个VS2012。

但是。这不装不要紧,debug一下自己原来的程序,结果出现了“error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”这种错误,想想都非常无语。

细致分析了一下这个问题。原来是微软的链接文件的格式变了

解决方式1:

微软官方给出的详细解决方法是给VS2010打SP1补丁:
下载地址是:http://www.microsoft.com/en-us/download/details.aspx?

id=23691

解决方式2:

是嵌入清单的问题。于是对该project以及全部依赖project进行例如以下操作:
右键->project属性->配置属性-> 清单工具->输入和输出->嵌入清单。选择[否]

1>LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
1>CVTRES : fatal error CVT1100: 资源反复。类型: MANIFEST,名称: 1,语言: 0x0409

这个是因为日志文件引起的。能够将

项目\属性\配置属性\清单工具\输入和输出\嵌入清单:原来是“是”,改成“否”。

或者将

项目\属性\配置属性\链接器\清单文件\生成清单:原来是“是”。改成“否”。


处置方法解释:

1、如果名目是一个静态库,也许说,名目中没有本质的资源文件的时候,将嵌入清单改成“否”是可能处置的。

2、如果名目已有了资源文件。将嵌入清单改成“否”是不行能处置效果的,除非你同一时候把这些资源文件移除掉。

论断,确保名目中没有资源文件的存在。且把嵌入清单改成“否”可能处置该效果,但这确实也失掉了资源文件的作用。没措施。谁让他是个Bug呢。






本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/5414161.html,如需转载请自行联系原作者 

相关文章
|
IDE Shell 网络安全
Visual Studio 2022 git error Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa
Visual Studio 2022 git error Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa
283 0
Visual Studio 2022 git error Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa
|
1月前
|
C++
Visual Studio 2022编译错误 Error MSB8041-此项目需要MFC库解决方案
Visual Studio 2022编译错误 Error MSB8041-此项目需要MFC库解决方案
|
Android开发 C++
【错误记录】Visual Studio 中编译 NDK 报错 ( error : cannot use ‘throw‘ with exceptions disabled )
【错误记录】Visual Studio 中编译 NDK 报错 ( error : cannot use ‘throw‘ with exceptions disabled )
622 0
【错误记录】Visual Studio 中编译 NDK 报错 ( error : cannot use ‘throw‘ with exceptions disabled )
|
IDE 开发工具 C++
Visual Studio下程序开发: error LNK2019: 无法解析的外部符号
Visual Studio下程序开发: error LNK2019: 无法解析的外部符号
851 0
Visual Studio下程序开发: error LNK2019: 无法解析的外部符号
|
IDE 开发工具
Visual Studio下程序开发: 引用库出现 error LNK2026: 模块对于 SAFESEH 映像是不安全的。
Visual Studio下程序开发: 引用库出现 error LNK2026: 模块对于 SAFESEH 映像是不安全的。
105 0
Visual Studio下程序开发: 引用库出现 error LNK2026: 模块对于 SAFESEH 映像是不安全的。
|
数据安全/隐私保护 C++ Windows
Visual Studio 2005 -- Error code 1603 for this component means "Fatal error during installation.
  Visual Studio 2005 -- Error code 1603 for this component means "Fatal error during installation.   这几天,因为某个项目需要而要安装VS2005,不知怎么回事,一安装到Microsoft Document Explorer 2005就提示安装失败,怎么也继续不下去了,在网上查了很多资料,试了很多方法都没有解决,就差就重装系统了,呵呵。
964 0
|
1月前
|
Windows
Qt 5.14.2 打造跨平台应用的秘诀:用Visual Studio 2022和Qt 5.14.2轻松创建你的首个QT项目
Qt 5.14.2 打造跨平台应用的秘诀:用Visual Studio 2022和Qt 5.14.2轻松创建你的首个QT项目
|
2月前
|
编译器 C++
Visual Studio 2022中创建的C++项目无法使用万能头<bits/stdc++.h>解决方案
Visual Studio 2022中创建的C++项目无法使用万能头<bits/stdc++.h>解决方案
46 0
Visual Studio 2022中创建的C++项目无法使用万能头<bits/stdc++.h>解决方案