在Windows上部署Qt应用程序? [英] Deploying a Qt application on Windows?

查看:252
本文介绍了在Windows上部署Qt应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Qt的新手,无法弄清楚如何在Windows上部署一个简单的Qt应用程序。它运行良好,当从内部运行时Qt Creator,但它不会运行时直接执行。我已经安装了最新版本的Qt SDK,并且正在使用所有的默认设置。

I'm new to Qt and cannot figure out how to deploy a simple Qt application on Windows. It runs fine when run from inside Qt Creator, but it won't run when directly executed. I have the newest version of the Qt SDK installed and am using all of the default settings.

我已经阅读了几十个如何指南,所有这些都提供了冲突信息,除了几十个论坛帖子,博客文章和在这里的问题。我根本找不到明确说明如何在Windows上部署Qt应用程序的说明。

I have read dozens of "how to" guides, all of which provided conflicting information, in addition to dozens upon dozens of forum threads, blog posts, and questions on here. I simply cannot find instructions that clearly explain how to deploy a Qt application on Windows.

我试图将所有的DLLs放在应用程序目录中,但是didn' t工作。

I tried putting all the DLLs I could find in the application directory, but that didn't work. I also tried building Qt statically, but that didn't work either.

任何人都可以帮我吗?

编辑:感谢您的回复。以下是一些其他信息:

Thank you both for your replies. Here is some additional information:

我使用的是Qt Creator 2.4.1,基于Qt 4.7.4

I am using "Qt Creator 2.4.1, Based on Qt 4.7.4"

我有以下包括不同的文件:

I have the following includes across different files:

#include <QtGui/QApplication>
#include <QDebug>
#include <QTextEdit>
#include <QtGui>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include "qthread.h"
#include "windows.h"
#include <QMessageBox>

我使用Qt,MinGW附带的默认编译器。

I'm using the default compiler that came with Qt, MinGW.

推荐答案

首先,请张贴细节,如

您正在使用哪个qt版本?
你使用什么模块 - QtNetwork,QTGui等?

Which qt version you are working on? What modules are you using - QtNetwork, QTGui etc ?

最后使用什么编译器,MinGW,MSVC?

Lastly what compiler are you using, MinGW, MSVC ?

所有你需要做的是在应用程序目录中部署QTCore dll和其他包含在项目中的模块的dll。

All you need to do is deploy QTCore dll and other dlls for modules you have included in your project in the application directory.

正在使用MSVC编译器,则必须部署MSVC运行时。

Further, if you are using MSVC compiler, you will have to deploy MSVC runtime. You can find the redistributable on the microsoft website.

或者,如果您使用mingw,那么您可能需要部署适当的g ++运行时。

Alternatively if you are using mingw then you might need to deploy proper g++ runtime.

如果您仍然无法部署包含上述信息的应用程序,请提供其他详细信息,以便我们建议正确的方式。

If you are still unable to deploy the application with above information, provide the additional details so I can suggest the correct way.

这篇关于在Windows上部署Qt应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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