Using the windeployqt tool, all dependent files necessary for running the program are placed alongside the executable file. I want to merge these dependent files, which have the .dll extension, with the executable file having the .exe extension. This means that for distributing and running the program, I only want to have one executable file (.exe).
I would appreciate it if you could guide me through this process.
To achieve a single executable file without external DLL dependencies in Qt, you can use static linking instead of dynamic linking. Static linking includes all necessary libraries directly into the executable, so you won't need separate DLL files.
you need to add
in your .pro file and also you need to change your
qmakeconfiguration. This means you must build Qt statically by configuring Qt with -static.If you've installed Qt online using the pre-built binaries provided by the Qt Company, you won't be able to configure Qt for static building from the installed files directly. The pre-built binaries are configured by the Qt Company to support dynamic linking by default, and they are not designed to be reconfigured after installation.
To build Qt statically, you must download the Qt source code and compile it yourself with the desired configuration options.
Please watch this YouTube video :
https://www.youtube.com/watch?v=chMNUzpN4pw
Also, you can read more from This Qt Documentation :
https://doc.qt.io/qt-6/windows-deployment.html