C++ “应用程序未能正确初始化 (0xc000007b)。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3378616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"The application failed to initialize properly (0xc000007b)."
提问by lordstyx
I get this error when i try to start a program that I've made in C++. It works fine on my other computer (XP SP3 32bit) but not on my windows 7 64 bit version. When I run Dependency Walker on the program, it tells me that IESHIMS.dll is missing, however it's there in the Internet Explorer folder of both 32 and 64 bit version..
当我尝试启动我用 C++ 编写的程序时出现此错误。它在我的另一台计算机(XP SP3 32 位)上运行良好,但在我的 Windows 7 64 位版本上运行良好。当我在程序上运行 Dependency Walker 时,它告诉我 IESHIMS.dll 丢失了,但是它在 32 位和 64 位版本的 Internet Explorer 文件夹中。
Can anyone help me with this?
谁能帮我这个?
回答by Hans Passant
The error code is STATUS_INVALID_IMAGE_FORMAT, "Mumbleis either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support."
错误代码是 STATUS_INVALID_IMAGE_FORMAT,“ Mumble不是为在 Windows 上运行而设计的,或者它包含错误。请尝试使用原始安装介质重新安装该程序,或者联系您的系统管理员或软件供应商以获得支持。”
Which is a bit outdated perhaps for the 64-bit version of Windows, the 90% odds are that your 32-bit program is trying to load a 64-bit DLL. There's a lot that Windows does to prevent that from ever happening. File system virtualization ensures that DLL loads from c:\windows\system32 are redirected to c:\windows\syswow64, home of the 32-bit DLLs. Registry virtualization ensures that COM servers are matched with the bit-ness of the COM client.
对于 64 位版本的 Windows,这可能有点过时,90% 的可能性是您的 32 位程序正在尝试加载 64 位 DLL。Windows 做了很多事情来防止这种情况发生。文件系统虚拟化可确保从 c:\windows\system32 加载的 DLL 被重定向到 c:\windows\syswow64,即 32 位 DLL 的主页。注册表虚拟化可确保 COM 服务器与 COM 客户端的位数相匹配。
There's something you do that bypasses these counter-measures. Maybe you used SetDllDirectory(). Or you copied DLLs to the same folder as your EXE. Or you are hoping that the system's PATH environment variable helps your program find the right DLL. Something like that, it isn't otherwise clear from your question. There ought to be a record of it in the Windows event log (not 100% sure). If all else fails, SysInternals' ProcMon utility can show you what file it is trying to load.
你做的一些事情可以绕过这些反措施。也许你使用了 SetDllDirectory()。或者您将 DLL 复制到与 EXE 相同的文件夹中。或者您希望系统的 PATH 环境变量帮助您的程序找到正确的 DLL。像这样的事情,从你的问题中还不清楚。Windows 事件日志中应该有它的记录(不是 100% 确定)。如果所有其他方法都失败了,SysInternals 的 ProcMon 实用程序可以向您显示它正在尝试加载的文件。