为了测试部署过程,我正在尝试部署随附的演示应用程序Minehunt。我能够运行它,没有崩溃或错误,但是屏幕全是白色。
我相信这通常意味着我缺少插件。Dependency Walker报告没有问题,我什至尝试包括Qt MingW plugins目录中的所有插件,但没有运气。
到目前为止,这是我要包括的内容;谁能建议我还需要添加什么才能使其运行?
Your dlls don't look bad at all. I think, too, that it's your plugins. Even if they are there, there is a good chance, that your program don't find them. Qt is a bit picky where to look by default. You might try qt.conf
. This is a small textfile you must create in the folder where your executable lies. It contains the path to your Qt plugins.
For instance, in one of my projects I have the followin folder layout:
Appfolder plugin qt plugins imageformats sqldrivers myapp.exe qt.conf ...many dlls...
Then I added a qt.conf file to the Appfolder, which has the following content:
[Paths] Plugins = plugins/qt/plugins
我的程序是Qt 4,但我认为Qt5中插件部署的这一方面没有改变。我所有的qt dll都在qt中。然后添加以下路径:SET PATH=.\plugins;.\plugins\qt;%PATH%
。在我尝试过的任何Windows上都像魅力一样工作。
编辑:然后,我创建了一个.bat文件,该文件执行以下操作:
SET PATH =。\ plugins;。\ plugins \ qt;%PATH% cd Appfolder 启动myapp
这是一个丑陋的快速修复程序,但是我还没有时间用更好的东西来替代它。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句