VC2008 下 R6030错误

来源:互联网 发布:淘宝盖楼在哪 编辑:程序博客网 时间:2024/06/08 04:34
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 libraryincorrectly..."
I spent a week's hard work on this issue, come tothe following conclusion:
(1) The problem: A.EXE depends on {B.DLL, MSVCR80D.DLL}; B.DLLdepends on {MSVCR80.DLL}; A.EXE runs into exception R6034, as thetitle.
(2) The fix: replace B.DLLwith B_DEBUG.DLL, which providesthe 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:
 <assemblyxmlns="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.CRTshare the common publicKeyToken "1fc8b3b9a1e18e3b", so the"assembly" loading mechanism get into a mess.
(3.4) Hypothesis02: If compile and link B.DLL withVC6.0, then no "assembly"conception nor "assembly loading mechanism", northe R6034 exception.
(3.5) Conclusion01: The statement "An application has made anattempt to load the C runtime library without using a manifest"miss the point and some enhancement of document is necessary.

0 0
原创粉丝点击