VC2008 下 R6030错误

REF
一个解决方法,实验通过
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\"")

不同版本的编译器,name和version可能不同,具体在debug目录下的*.manifest中查找


没有试验成功,仅供参考
runtime exception R6034: "...attempt to load the C runtime library incorrectly..."
I spent  a week's hard work on this issue, come to the following conclusion:
(1) The problem: A.EXE depends on {B.DLL, MSVCR80D.DLL}; B.DLL depends on {MSVCR80.DLL}; A.EXE runs into exception R6034, as the title.
(2)  The fix: replace B.DLL with  B_DEBUG.DLL, which  provides the same API as B.DLL but  depends on {MSVCR80D.DLL}, and get A1.EXE. A1.EXE runs fine.
(3) reasoning and conclusions:
(3.1)Check the embeded manifest of B_DEBUG.DLL:
  <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
      <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
      </dependentAssembly>
  </dependency>
</assembly>
(3.2) Check the embeded manifest of B.DLL:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
      <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
      </dependentAssembly>
  </dependency>
</assembly>
(3.3) Hypothesis01: Microsoft.VC80.DebugCRT and Microsoft.VC80.CRT share the common publicKeyToken "1fc8b3b9a1e18e3b", so the "assembly" loading mechanism get into a mess.
(3.4) Hypothesis02: If compile and link B.DLL with VC6.0,  then no "assembly" conception  nor "assembly loading mechanism", nor the R6034 exception.
(3.5) Conclusion01: The statement "An application has made an attempt to load the C runtime library without using a manifest" miss the point and some enhancement of document is necessary.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值