Windows 10:应用程序无法正确启动 (0xc000a200) [英] Windows 10: The application was unable to start correctly (0xc000a200)

查看:87
本文介绍了Windows 10:应用程序无法正确启动 (0xc000a200)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Windows 10 上开发我的 QT 应用程序.开发完成(就目前而言).

I am developing my QT application on windows 10 . The development is complete (as for now).

从 QT-creator 以调试模式运行应用程序后,我试图从构建目录运行可执行文件.但它向我显示了一个带有以下消息的应用程序错误"对话框:

After run the application in debug mode from QT-creator, I am trying to run the executable from the build directory. But it shows me an "Application Error" dialog with the following message:

应用程序无法正确启动 (0xc000a200).单击确定关闭应用程序.

The application was unable to start correctly (0xc000a200). Click OK to close the application.

问题是什么以及如何解决?!

What is the problem and How to fix it ?!

推荐答案

错误代码在错误消息中给出是有原因的.他们对普通用户没有任何意义,但我们是程序员,我们是目标受众.现在谷歌已经被发明了,你绝对没有理由不花 5 秒钟时间谷歌一下错误代码,看看它意味着什么.

The error codes are given to you in the error message for a reason. They don't mean anything to regular users, but we're programmers and we are the intended audience. Now that Google has been invented, you have absolutely no excuse for not taking the 5 seconds to Google the error code and see what it means.

在这种情况下,0xc000a200 是对应于 STATUS_NOT_APPCONTAINER 的错误代码.COM 错误代码的主列表位于 Windows SDK 标头中,特别是 ntstatus.h.如果你查一下这个,你会看到下面的描述:

In this case, 0xc000a200 is an error code that corresponds to STATUS_NOT_APPCONTAINER. The master list of COM error codes is in the Windows SDK headers, specifically ntstatus.h. If one looks this one up, one sees the following description:

此操作仅在应用容器的上下文中有效.

This operation is only valid in the context of an app container.

现在,诚然,一旦你到了这一点,你可能会发现你已经完全不知所措了.您可能不知道什么是应用程序容器,当然也不知道如何修复它.但至少这样你就可以问一个好问题,这对你得到一个好的答案大有帮助.

Now, admittedly, once you get to this point, you may discover that you are in well over your head. You may not have any idea what an app container is, and certainly no clue about how to fix it. But at least then you would be able to ask a good question, which will go a long way to getting you a good answer.

但让我们看看这次你能不能走运.当不在应用容器内的应用程序尝试加载标记为应用容器一部分的 DLL 时,最常遇到此错误.链接器负责将 DLL 标记为是或不是应用程序容器的一部分,由您使用的任何链接器的一系列选项控制.在 Microsoft 的链接器上,它是 /APPCONTAINER:YES/APPCONTAINER:NO 控制这个.我不确定 Qt Creator 使用什么工具链,但如果它不是 Microsoft 的,这至少应该让您开始在该链接器的文档中寻找正确的位置.确保您的应用程序使用的所有 DLL 都没有被标记为应用程序容器的一部分.

But let's see if you can get lucky this time anyway. This error is most commonly encountered when an application that is not inside of an app container tries to load a DLL that is marked as being part of an app container. It is the linker that is responsible for marking a DLL as being or not being part of an app container, controlled by a series of options for whatever linker you're using. On Microsoft's linker, it is /APPCONTAINER:YES and /APPCONTAINER:NO that control this. I'm not sure what toolchain Qt Creator uses, but if it is not Microsoft's, this should at least get you started looking in the right place in that linker's documentation. Make sure that all DLLs used by your application are not being marked as part of an app container.

默认情况下,对于常规 C++ 桌面应用程序项目,该选项应关闭,但其中一个 DLL 可能作为 Windows 应用商店应用程序的一部分开始.或者可能是开关不小心被扔了.

The option should be off by default for a regular C++ desktop application project, but it's possible that one of the DLLs started out life as part of a Windows Store app. Or it's possible that the switch just got thrown accidentally.

这篇关于Windows 10:应用程序无法正确启动 (0xc000a200)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆