Unsolved embed qt dlls in exe
-
i'm building a small application using visual studio.
however, i need to provideQt5Core.dll
,Qt5Gui.dll
andQt5Widgets.dll
with the.exe
.
is there a way to embed (make a part of) the libs (Qt5Core.lib
, etc.) into the executable? -
Hi
Yes its called static linking but it requires a commercial license unless you app is
open source.https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows
-
i have the license
-
Super, then you just need to build a static version of Qt and compile app with it.
-
actually i only have the installer of qt, but also the libs from the installation. can't i do it using those?
-
@user4592357
well you need to get the source code of Qt.
The installer has option for that.
You might need to install some extra stuff.I found these helpful with visual studio
https://github.com/fpoussin/Qt5-MSVC-Static -
Hi
No, the version you can download is for dynamic loading only.
You can only do static if the Qt version is made for that.
Make sure to use all cores of your pc as else it takes long time to compile :) -
i built static version of qt using the instructions from here: Build Qt 5.7 Statically Using MSVC.
i also setup the kit in qt creator as described in the article. now when i try to build the app, this is what i get:
17:45:08: Running steps for project untitled... 17:45:08: Starting: "C:\Qt\Static\5.10.1\bin\qmake.exe" C:\Users\user\Documents\untitled\untitled.pro -spec win32-msvc "CONFIG+=qml_debug" Could not find qmake configuration file win32-msvc. Error processing project file: C:\Users\user\Documents\untitled\untitled.pro 17:45:08: The process "C:\Qt\Static\5.10.1\bin\qmake.exe" exited with code 3. Error while building/deploying project untitled (kit: Qt 5.10.1 Static) The kit Qt 5.10.1 Static has configuration issues which might be the root cause for this problem. When executing step "qmake" 17:45:08: Elapsed time: 00:00.
-
Hi
and its just a new test project ?
and you do in fact have the win32-msvc file/folder?