0

我正在使用 botan Libary 在 vs 2008 上生成二维码我收到错误“R6034:尝试错误地加载 C 运行时库”。其MFC/C++应用及
MFC的使用:在共享DLL
代码生成中使用MFC :《多线程调试DLL(/MDd)》

我已经在四分钟内完成了线程,他们说需要添加清单文件,我已经有一个,请帮我解决这个问题

这是我的 App.exe.manifest.v “sigcheck.exe - m QrCodeTest.exe”

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
   <requestedPrivileges>
     <requestedExecutionLevel level="asInvoker" uiAccess="false">   </requestedExecutionLevel>
   </requestedPrivileges>
 </security>
</trustInfo>

<dependency>
 <dependentAssembly>
   <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
 <dependentAssembly>
   <assemblyIdentity type="win32" name="Microsoft.VC90.DebugMFC" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
 </dependentAssembly>
</dependency>

<dependency>
 <dependentAssembly>
   <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
 </dependentAssembly>
</dependency>

</assembly>

输出:

'QrCodeTest.exe': Loaded 'D:\Project\QrCodeTest\Debug\QrCodeTest.exe', Symbols loaded.
 QrCodeTest.exe': Loaded 'C:\Windows\System32\ntdll.dll'
 QrCodeTest.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\KernelBase.dll'
'QrCodeTest.exe': Loaded 'D:\Project\QrCodeTest\Debug\botan.dll', Binary was not built with debug information.
'QrCodeTest.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\sechost.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\user32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\lpk.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\usp10.dll'
'QrCodeTest.exe': Loaded 'D:\Project\QrCodeTest\Debug\msvcp90.dll'
'QrCodeTest.exe': Loaded 'D:\Project\QrCodeTest\Debug\msvcr90.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugmfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_bfff6c932d60651e\mfc90ud.dll', Symbols loaded.
'QrCodeTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll', Symbols loaded.
'QrCodeTest.exe': Loaded 'C:\Windows\System32\shlwapi.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-con trols_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\msimg32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\ole32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll', Symbols loaded.
'QrCodeTest.exe': Loaded 'C:\Windows\System32\imm32.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\msctf.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'QrCodeTest.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
The program '[2708] QrCodeTest.exe: Native' has exited with code -1073741502 (0xc0000142).

依赖关系 我针对依赖关系运行了Debug exe,这里botan应该加载MSVCP90.dll和MSVCR90.dll而不是MSVCP90D.dll和MSVCR90D.dll。这是造成混乱的原因吗?如果是如何纠正它。

在此处输入图像描述

4

2 回答 2

3

这一定是Botan.dll的构建方式引起的问题。显然,您已经获得了此 DLL 的发布版本,因为它依赖于 CRT 的发布版本。通常,将其与使用 CRT 调试版本的调试版本混合在一起是非常不健康的,它可能会导致难以诊断运行时错误或内存泄漏。

DLL 应该有它自己的清单来说明它的依赖关系。嵌入为资源 ID 为 2 的 RT_MANIFEST。您可以检查 Botan.dll 在 Visual Studio 中是否有一个。使用 File + Open + File,选择 Botan.dll,你会看到资源。找到 RT_MANIFEST 节点并将其打开。验证资源 2 是否存在并且它声明它需要“Microsoft.VC90.CRT”

期望您看不到它,从而触发错误。使用正确的清单构建它并且通常尝试获取此 DLL 的调试版本对于取得成功很重要。

于 2013-01-23T14:17:29.957 回答
0

I have downloaded botan source code which is part of Qt Creator Source from
ftp://ftp.qt-project.org/qtcreator/qt-creator-2.1.0-src and compiled it in Qt Creator. It will give you botand.dll and botand.lib which is debug version of botan lib.If you download the Windows binary from http://botan.randombit.net/download.html,it won't contain debug version binary which obvious.It might run well for some but will also cause problem for others.So one generate debug binary in this way.

Hope it will help others

于 2013-01-23T15:25:36.870 回答