简体   繁体   English

Qt 5.0.1:应用程序不会在Qt创建者之外执行

[英]Qt 5.0.1: Application will not execute outside of Qt creator

I am trying to run the program TransitTalker.exe, which is my compiled code from qt, as shown in this picture: 我正在尝试运行TransitTalker.exe程序,这是我从qt编译的代码,如下图所示:

https://www.dropbox.com/s/ypgklrm4uschri5/filecontents.png https://www.dropbox.com/s/ypgklrm4uschri5/filecontents.png

(Note that I do not have sufficient reputation to post images, which the reason why I provided a link to the image) (请注意,我没有足够的声誉来发布图片,这就是我提供图片链接的原因)

My problem: 我的问题:

  • My program does not execute outside of qt creator. 我的程序不在qt creator之外执行。

  • I get the following message attempting to run TransitTalker.exe: "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." 我收到以下消息尝试运行TransitTalker.exe: “此应用程序已请求运行时以不寻常的方式终止它。请联系应用程序的支持团队以获取更多信息。”

What have I done already: 我已经做了什么:

  • I have added the required dll's (Except GPSVC.dll and IESHIMS.dll). 我添加了所需的dll(除了GPSVC.dll和IESHIMS.dll)。 I found the required dll's thru a program called dependency walker. 我通过一个名为dependency walker的程序找到了所需的dll。

  • I made sure my program runs inside qt creator, with no errors. 我确保我的程序在qt creator中运行,没有错误。

My main question: Why am I receiving this runtime message: "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." 我的主要问题:为什么我收到此运行时消息: “此应用程序已请求Runtime以不寻常的方式终止它。请联系应用程序的支持团队以获取更多信息。” . I want to be able to run my program, TransitTalker.exe as an qt standalone application. 我希望能够将我的程序TransitTalker.exe作为qt独立应用程序运行。

Running qt creator 5.0.1 (MINGW 47_32). 运行qt creator 5.0.1(MINGW 47_32)。 I have Visual Studio 2012 on the same computer as well. 我也在同一台计算机上安装了Visual Studio 2012。

I know this is marked as solved but I had the same problem and I solved it by copying libEGL.dll from the Qt binaries directory. 我知道这标记为已解决,但我遇到了同样的问题,我通过从Qt二进制文件目录复制libEGL.dll解决了这个问题。 for some odd reason it didn't show up in the dependency check, I had to look through the long debug log to see what libraries actually got loaded. 由于一些奇怪的原因它没有出现在依赖检查中,我不得不查看长调试日志以查看实际加载的库。 (and it isn't in your image, so it is quite likely the same problem) (它不在你的图像中,所以它很可能是同样的问题)

I got my application to work now. 我现在让我的申请工作了。 See solution below on how I did it. 请参阅下面的解决方案我是如何做到的。

Dmitry is correct that MinGW GCC 4.7 is not compatible with Qt 5.0.1, which I verified thru this post 德米特里是正确的,MinGW GCC 4.7与Qt 5.0.1 兼容,我通过这篇文章验证了这一点

My Solution : I installed Qt Creator 4.8 SDK which uses MinGW GCC 4.4. 我的解决方案 :我安装了使用MinGW GCC 4.4的Qt Creator 4.8 SDK。 I was able to run my application executable outside of the Qt Creator. 我能够在Qt Creator之外运行我的应用程序可执行文件。

My guess is that Qt is having some kind of startup-time assertion failure (eg in the QApplication constructor) and is printing a message to stdout (or stderr?) and then, err, "terminating the app in an unusual way". 我的猜测是Qt正在进行某种启动时断言(例如在QApplication构造函数中)并且正在向stdout(或stderr?)打印消息,然后错误地“以不寻常的方式终止应用程序”。

If that's the case, then you'll want to find out what that error message says. 如果是这种情况,那么您将需要找出错误消息所说的内容。 One way to do that would be to add the following code temporarily to the top of main(): 一种方法是将以下代码临时添加到main()的顶部:

AllocConsole();
freopen("conin$",  "r", stdin);
freopen("conout$", "w", stdout);
freopen("conout$", "w", stderr);

... then recompile your program and run it again. ...然后重新编译您的程序并再次运行它。 When it runs, an MS-DOS shell-window should appear, watch it for any informative messages about why Qt is unhappy. 当它运行时,应该出现一个MS-DOS shell窗口,观察它有关Qt不满意的任何信息性消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM