qt

Run .EXE without Qt


I want to run my app created with QtSDK on a machine that does not have Qt installed.

I tried to copy the DLL's from the BIN folder to the release of my project, but it did not work.

I tried the following:

The following error occurred:

microsoft visual c++ runtime library: this application has requested the runtime to terminate it in an unusual way

Q: What I really want to know:

How do I run an application built in Qt on other computers (Windows) without Qt installed?

Details:

Folders:

Qt/Mingw:


File .pro:

QT += webkitwidgets network core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = browsertest
TEMPLATE = app

RC_FILE = browser.rc

SOURCES += main.cpp\
 mybrowser.cpp

HEADERS += mybrowser.h

FORMS += mybrowser.ui

If any information you missed, please let me know. grateful


Solution

  • To distribute your application you need to copy the DLLs (only the DLLs necessary).

    1. Copy the DLLs necessary from <DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\ or <DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\bin\

      eg.: C:\Qt\Qt5.2.0\5.2.0\mingw48_32\ or C:\Qt\Qt5.2.0\5.2.0\mingw48_32\bin

    2. Paste the folder of your application.

    3. Then copy the folders inside of <DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\plugins

      eg.: C:\Qt\Qt5.2.0\5.2.0\mingw48_32\plugins

    4. Paste the folders of your application.

    Note: In this example (below), it was necessary to copy DLLs from different places and remove the Debug DLLs (used only to compile in Debug).

    Note that the debug dlls end with "d.dll", for example: Qt5Core.dll and Qt5Cored.dll or Qt5Concurrent.dll and Qt5Concurrentd.dll, the ending with "d.dll" should not be copied.

    The structure should look something like this (example):

    Only some DLLs the mingw will be needed, so I recommend using the Dependency Walker 2.2

    The result should look like this (not all dlls are needed, this can vary by project type): app folder


    Thanks to: