qtstaticexecutable

Tutorial for building single exe for Qt


So I want to find a tutorial that teach how to build single EXE using Qt. i use mingw and windeployqt for deployment (still some dll is missing and i manually copy them) then it works.

But i do not understand the steps in https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows

It indicated to build static version of Qt.

> configure -static -release -no-exceptions
> mingw32-make sub-src

But where do i type this at? When I open Cmd prompt and type it immediately, it just say "configure" is not recognized as an internal or external command....

Does this mean I need to close Qt Creator, build a "static" version of Qt Creator and then run a static version of Qt Creator? It is very confusing for me. Apologies cause I am new to this.


Solution

  • Make sure you have mingw, perl and python in your path. Download Qt source zip of your choice from here. Extract zip to the file system, e.g. C:\src\

    Now you open a command prompt, go into the Qt source root and run configure and make from there.

    cd C:\src\qt-<something>