关于VC6.0++中以及VS2008中编译出现的LINK错误
2011-10-29 22:30
381 查看
在使用古董级版本的VC6.0++的时候,经常会出现编译后运行程序,然后修改了程序之后会出现如下错误:
--------------------Configuration: 123 - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1168: cannot open Debug/123.exe for writing
执行 link.exe 时出错.
造成这种情况的原因是因为在第一次运行程序以后没有关掉可执行文件,所以当再次编译时系统当然不会让你通过了,就会导致连接错误了。
所以只要关掉运行的可执行文件就行了。但是有时候连exe程序都没有办法关闭,这个时候只好重新打开了
最近在vs2008里面也遇到过类似的错误,提示可能类似下面:
1>LINK : fatal error LNK1000: Internal error during BuildLibrary
1>
1> Version 10.00.31118.01
1>
1> ExceptionCode = C0000005
1> ExceptionFlags = 00000000
1> ExceptionAddress = 50EA5E1E (50D20000) "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\c2.dll"
1> NumberParameters = 00000002
1> ExceptionInformation[ 0] = 00000000
1> ExceptionInformation[ 1] = 05E86000
1>
1> CONTEXT:
1> Eax = 04034228 Esp = 004AD860
1> Ebx = 04311932 Ebp = 004AD868
1> Ecx = 05E85FF8 Esi = 008BB180
1> Edx = 04030000 Edi = 00000000
1> Eip = 50EA5E1E EFlags = 00010202
1> SegCs = 00000023 SegDs = 0000002B
1> SegSs = 0000002B SegEs = 0000002B
1> SegFs = 00000053 SegGs = 0000002B
1> Dr0 = 00000000 Dr3 = 00000000
1> Dr1 = 00000000 Dr6 = 00000000
1> Dr2 = 00000000 Dr7 = 00000000
据说这是微软的一个bug,微软方面是这样回复的:
由 Microsoft 在 2011/2/15 15:09 发送
We have seen similar failure in the past when people build library from OBJs having same PCH. The problem has been fixed and will appear in our future release.
Thanks for the bug report.
解决办法:
项目->属性->链接器->常规 下面的“启用增量链接”,将“是(/INCREMENTAL)”改为“否(/INCREMENTAL:NO)”。
不过这又引入了另外一个警 告:FormatCom.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/INCREMENTAL:NO”规范)
选择项目,属性->配置属性 ->C/C++,修改“调试信息格式”为“程序数据库(/Zi)”即可。
到此问题解决,据说这是VC的一个内部BUG,可以下载KB948127补丁来解决,但我并没有能正常安装该补丁。
下载补丁地址:http://code.msdn.microsoft.com/KB948127
--------------------Configuration: 123 - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1168: cannot open Debug/123.exe for writing
执行 link.exe 时出错.
造成这种情况的原因是因为在第一次运行程序以后没有关掉可执行文件,所以当再次编译时系统当然不会让你通过了,就会导致连接错误了。
所以只要关掉运行的可执行文件就行了。但是有时候连exe程序都没有办法关闭,这个时候只好重新打开了
最近在vs2008里面也遇到过类似的错误,提示可能类似下面:
1>LINK : fatal error LNK1000: Internal error during BuildLibrary
1>
1> Version 10.00.31118.01
1>
1> ExceptionCode = C0000005
1> ExceptionFlags = 00000000
1> ExceptionAddress = 50EA5E1E (50D20000) "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\c2.dll"
1> NumberParameters = 00000002
1> ExceptionInformation[ 0] = 00000000
1> ExceptionInformation[ 1] = 05E86000
1>
1> CONTEXT:
1> Eax = 04034228 Esp = 004AD860
1> Ebx = 04311932 Ebp = 004AD868
1> Ecx = 05E85FF8 Esi = 008BB180
1> Edx = 04030000 Edi = 00000000
1> Eip = 50EA5E1E EFlags = 00010202
1> SegCs = 00000023 SegDs = 0000002B
1> SegSs = 0000002B SegEs = 0000002B
1> SegFs = 00000053 SegGs = 0000002B
1> Dr0 = 00000000 Dr3 = 00000000
1> Dr1 = 00000000 Dr6 = 00000000
1> Dr2 = 00000000 Dr7 = 00000000
据说这是微软的一个bug,微软方面是这样回复的:
由 Microsoft 在 2011/2/15 15:09 发送
We have seen similar failure in the past when people build library from OBJs having same PCH. The problem has been fixed and will appear in our future release.
Thanks for the bug report.
解决办法:
项目->属性->链接器->常规 下面的“启用增量链接”,将“是(/INCREMENTAL)”改为“否(/INCREMENTAL:NO)”。
不过这又引入了另外一个警 告:FormatCom.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/INCREMENTAL:NO”规范)
选择项目,属性->配置属性 ->C/C++,修改“调试信息格式”为“程序数据库(/Zi)”即可。
到此问题解决,据说这是VC的一个内部BUG,可以下载KB948127补丁来解决,但我并没有能正常安装该补丁。
下载补丁地址:http://code.msdn.microsoft.com/KB948127
相关文章推荐
- 关于VC6.0++中以及VS2008中编译出现的LINK错误
- CentOS 在编译php 的时候可能出现的错误以及需要安装的类库
- VS2008编译错误—LINK : fatal error LNK1104: cannot open file 'LIBC.lib' from http://blog.csdn.net/lcbiotech/article/details/4762935
- 关于用turbo c 编译出现的 Declaration syntax error 错误 (未解决)
- 关于Matlab编译生成jar包时出现错误的解决办法
- FCKeditor关于图片上传出现错误“ 提示没有权限 Type=Image” 以及出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/conf
- vs2008 编译时 出现 -1073741289 错误
- 网狐荣耀前台网站编译出现找不到服务器‘RYAccountsDBLink’错误解决
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于Carbide编译出现perl脚本错误的解决方法
- 关于问题short s1 = 1; s1 = s1 + 1;出现编译错误,而 short s1 = 1; s1 += 1;不出现编译错误。
- 关于函数模版编译出现链接错误
- 关于在ubuntu16.04 64位系统上安装交叉编译工具出现错误的解决方法
- VS2008编译的mfc程序在没有安装的机子上运行出现配置错误的问题
- vs2008编译出现错误 error C2220: 警告被视为错误 - 没有生成“object”文件
- 关于myeclipse操作中出现的自动提示,以及误报错误问题总结
- vs210编译sevenzip 7-zip出现link error opt:nowin98的错误解决办法
- 关于IOS编译出现找不到XXX变量名的错误解决
- VC中在VS2008编译环境下创建属性表单中出现“所属资源不存在的错误”
- vs2008编译tamarin出现错误c2220:警告被视为错误