R6034 :Attempt to load C runtime library incorrectly

0

I am using botan Libary to generate the Qr Code on vs 2008 I am getting the error "R6034 :Attempt to load C run time library incorrectly". Its MFC/C++ application and
USE of MFC: Use MFC in Shared DLL
Code Generation : "Multi-threaded Debug DLL (/MDd)"

I have gone through thread in fourms they are saying manifest files needed to be added bit I already have one, Please help me resolve this issue

Here is my 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>

OUTPUT:

'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).

Dependency I ran Debug exe against dependency,here botan should load MSVCP90.dll and MSVCR90.dll instead of MSVCP90D.dll and MSVCR90D.dll.Is this the reason foe the mess.If it is how to rectifiey it.

enter image description here

visual-studio-2008
dll
unmanaged
side-by-side
winsxs
asked on Stack Overflow Jan 22, 2013 by Chris_vr • edited Jan 23, 2013 by Chris_vr

2 Answers

2

This must be a problem induced by the way Botan.dll was built. Clearly you've got the release build of this DLL since it has a dependency on the release version of the CRT. In general pretty unhealthy mixing that with your debug build that uses the debug version of the CRT, it can cause hard to diagnose runtime errors or memory leaks.

A DLL should have a manifest of its own that states its dependencies. Embedded as an RT_MANIFEST with resource ID 2. You can check if Botan.dll has one in Visual Studio. Use File + Open + File, select Botan.dll and you'll see the resources. Locate the RT_MANIFEST node and open it. Verify that resource 2 exists and that it states that it requires "Microsoft.VC90.CRT"

With the expectation that you don't see it, triggering the error. Getting it built with a correct manifest and in general trying to obtain the debug build of this DLL is important to get ahead.

answered on Stack Overflow Jan 23, 2013 by Hans Passant
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

answered on Stack Overflow Jan 23, 2013 by Chris_vr

User contributions licensed under CC BY-SA 3.0