简体   繁体   English

Qt5应用程序以静默方式退出另一台机器

[英]Qt5 application silently exits on another machine

When I try to run my application on another machine, where Qt SDK is not installed, it silently exits. 当我尝试在未安装Qt SDK的另一台机器上运行我的应用程序时,它会以静默方式退出。

Now, if it were missing a DLL, Windows would show a message box like this, and I would put the DLL: 现在,如果它丢失了一个DLL,Windows将显示一个这样的消息框,我会把DLL:

在此输入图像描述

But I've already installed all the DLLs indicated by this type of message boxes. 但我已经安装了此类消息框指示的所有DLL。 Besides, those message boxes happen on my machine, as well, until I put the DLLs in the same directory as the application. 此外,这些消息框也发生在我的机器上,直到我将DLL放在与应用程序相同的目录中。

Now the program just exits, no message boxes, and it exits only on other machines where Qt SDK is not installed. 现在该程序刚退出,没有消息框,并且只在未安装Qt SDK的其他机器上退出。

This happens only when compiling with Qt5, same program compiled with Qt4 runs fine on the other machine where the Qt5 program fails. 只有在使用Qt5进行编译时才会发生这种情况,使用Qt4编译的同一程序在Qt5程序失败的另一台机器上运行正常。

After some more digging I found out what the problem is - Qt5 also needs platform plugins, with the interesting twist that the application will silently fail on another machine, without any error message. 经过一番挖掘后,我发现了问题所在 - Qt5还需要平台插件,有趣的是,应用程序会在另一台机器上静默失败,没有任何错误消息。

Also, those plugins can't be in the same directory as the EXE, they have to be in their own sub-directories. 此外,这些插件不能与EXE位于同一目录中,它们必须位于各自的子目录中。

It seems I need only one plugin: 看来我只需要一个插件:

platforms/qwindows.dll

Where the platforms directory is placed in the exe's directory. platforms目录放在exe的目录中。

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

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