我有一个VS2008 SP1a (9.0.30729.4148)在Windows7 x64上构建的应用程序,它不想在XP下启动。
消息是The application failed to initialize properly (0x80000003). Click on OK to terminate the application.。我查看了depends.exe,发现msvcr90.dll确实尝试从KERNEL32.dll加载FlsAlloc,而FlsAlloc只有从Vista开始才可用。我确信应用程序没有使用它。
如何解决这个问题?
SxS包已经安装在目标机器上了--事实上,我已经安装了SxS的所有3个版本(初始版本、sp1和sp1+security修补程序)。
应用程序是用_BIND_TO_CURRENT_VCLIBS_VERSION=1编译的
此外,我还在stdafx.h上定义了正确的目标Windows版本
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500舱单文件
<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" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.MFC" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
</dependentAssembly>
</dependency>
</assembly>因果报应
在地址0x00400000处启动"c:\program“(进程0xA0)。成功钩住模块。加载"c:\windows\system32\NTDLL.DLL“地址0x7C900000。成功钩住模块。加载地址0x7C800000的“c:\windows\system32 32\KERNEL32.DLL”。成功钩住模块。加载地址0x785E0000的“c:\程序文件\app\MFC90.DLL”。成功钩住模块。在地址0x78520000上加载“c:\程序文件\app\MSVCR90.DLL”。成功钩住模块。加载地址0x7E410000的“c:\windows\system32 32\USER32.dll”。成功钩住模块。加载地址0x77F10000的“c:\windows\system32 32\GDI32.DLL”。成功钩住模块。加载"c:\windows\system32\SHLWAPI.DLL“地址0x77F60000。成功钩住模块。将“c:\windows\system32 32\ADVAPI32.dll”加载到地址0x77DD0000。成功钩住模块。将“c:\windows\system32 32\RPCRT4.DLL”加载到地址0x77E70000。成功钩住模块。将“c:\windows\system32 32\SECUR32.DLL”加载到地址0x77FE0000。成功钩住模块。加载"c:\windows\system32\MSVCRT.DLL“地址0x77C10000。成功钩住模块。加载地址0x5D090000的“c:\windows\system32 32\COMCTL32.DLL”。成功钩住模块。在地址0x76380000处加载“c:\windows\system32 32\MSIMG32.DLL”。成功钩住模块。加载地址0x7C9C0000的“c:\windows\system32 32\SHELL32.DLL”。成功钩住模块。加载地址0x77120000的“c:\windows\system32 32\OLEAUT32.DLL”。成功钩住模块。加载地址0x774E0000的“c:\windows\system32 32\OLE32.DLL”。成功钩住模块。到达入口点。所有隐式模块都已加载。DllMain(0x78520000,DLL_PROCESS_ATTACH,0x0012FD30)在"c:\program \app\MSVCR90.DLL“中调用。GetProcAddress(0x7C800000 c:\windows\system32 32\KERNEL32.dll,"FlsAlloc")从地址0x78543ACC的"c:\program \app\MSVCR90.DLL“调用并返回NULL。错误:找不到指定的过程(127)。GetProcAddress(0x7C800000 c:\windows\system32 32\KERNEL32.dll,"FlsGetValue")从地址0x78543AD9的"c:\program \app\MSVCR90.DLL“调用并返回NULL。错误:找不到指定的过程(127)。GetProcAddress(0x7C800000 c:\windows\system32 32\KERNEL32.dll,"FlsSetValue")从地址0x78543AE6的"c:\program \app\MSVCR90.DLL“调用并返回NULL。错误:找不到指定的过程(127)。GetProcAddress(0x7C800000 c:\windows\system32 32\KERNEL32.dll,"FlsFree")从地址0x78543AF3的"c:\program \app\MSVCR90.DLL“调用并返回NULL。错误:找不到指定的过程(127)。
我应该指出,我已经安装了Windows 7,并将其配置为默认SDK。
发布于 2010-08-09 09:50:25
清单工具确实有问题,唯一可靠的解决方案是不要将清单嵌入到二进制文件中,因为嵌入几乎是随机失败的。把舱单保持在外面是丑陋的,但至少总是有效的。
发布于 2011-06-15 18:50:31
我总是将清单嵌入到我的DLL中,并且从来没有遇到过问题。只有当我忘记嵌入清单时才会遇到问题。然后它无法在Windows 2008上找到MSVCR90.dll,但是它可以在旧版本的Windows上工作,这让我有一段时间感到困惑。
https://stackoverflow.com/questions/2443057
复制相似问题