如何使用Qt-Creator部署我的应用程序?

问题描述:

我正在尝试部署我的简单的Qt项目,就像一个你好的世界。

I'm trying to deploy my simple Qt project like a hello world.

我可以成功构建它,也可以在Qt-Creator上执行它。但是,由于某些共享库错误,我无法直接在发行文件夹中执行二进制文件。

I build it successfully and can also execute it on Qt-Creator. However, I can't execute the binary directly in the release folder due to some shared library errors.

所以我只需将一些基本库复制到发行文件夹,如qtcore .dll和qtgui.dll,但我仍然无法执行。

So I just copy some essential librarys to the release folder such as qtcore.dll and qtgui.dll, but I can't still execute it.

如何部署我的简单的Qt项目?还有另一个步骤来部署它?

How can I deploy my simple Qt project? Is there an another step to deploy it?

您还需要部署MINGW runtime dll( mingwm10.dll )。此文件位于您的 Qt\2009.5\mingw\bin 目录中。

You also need to deploy the MINGW runtime dll (mingwm10.dll). This file is located in your Qt\2009.5\mingw\bin directory.

还要注意您的应用程序是否以调试模式或发布模式进行编译。我刚刚用一个hello world类型的应用程序和Qt Creator进行了测试。在 debug 文件夹中,我复制了 libgcc_s_dw2-1.dll mingwm10.dll QtCored4.dll QtGuid4.dll ,它的工作原理。

Also pay attention to whether your application is compiled in debug mode or release mode. I just made the test with an hello world type application and Qt Creator. In the debug folders, I copied libgcc_s_dw2-1.dll, mingwm10.dll, QtCored4.dll and QtGuid4.dll and it works.

请注意dll名称中的 d ,代表debug: QtCore d 4.dll

Pay attention to the d in dll names, which stands for debug: QtCore d 4.dll.

请参阅 Qt 4.6:在Windows中部署应用程序
对于Qt 5,请查看此页面。