Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
External libraries with windeployqt
shaan7 last edited by
I use windeployqt to create a release package that runs on other Windows computers. It was all fine till I was using only Qt libraries and QML,I'd just run this-
windeployqt --qmldir C:\Qt\5.3\mingw482_32\qml myapp.exe @
The resulting package worked fine. Now, I am using an external library https://github.com/frankosterfeld/qtkeychain and using "Add Library" from Qt Creator adds it to .pro as follows-
@win32:CONFIG(release, debug|release): LIBS += -L$$PWD/third_party/qtkeychain-build/ -llibqt5keychain
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/third_party/qtkeychain-build/ -llibqt5keychaind
else:unix: LIBS += -L$$PWD/third_party/qtkeychain-build/ -llibqt5keychain
INCLUDEPATH += $$PWD/third_party
DEPENDPATH += $$PWD/third_party/qtkeychain
From Qt Creator, the project builds fine and runs file. However, windeployqt now complains-
@Unable to find dependent libraries of C:\Qt\5.3\mingw482_32\bin\libqt5keychain.dll :Cannot open 'C:/Qt/5.3/mingw482_32/bin/libqt5keychain.dll': The system cannot find the file specified.
Its because windeployqt doesn't read the .pro otherwise it would've figured out where is libqt5keychain.dll located.
How do I tell windeployqt the dll's location so it can pick it up? I tried adding the dir to PATH, but that doesn't seem to work.
Try using --libdir flag. Or just copy the DLL into C:\Qt\5.3\mingw482_32\bin
shaan7 last edited by
the --libdir flag didn't work, it says it will "Copy libraries to path" but we want to tell it where to find libraries. I could copy the DLL to C:\Qt\5.3\mingw482_32\bin, but is that really the right solution?
Maybe the tool is not mature enough yet. Have you tried with Qt 5.4? I think it is a good idea to file a feature request on the bugtracker.
[quote]but is that really the right solution?[/quote] If it works, then why not?
Mozi last edited by
Hi! @sierdzio .
> windeployqt --help Usage: windeployqt [options] [files] Qt Deploy Tool 5.14.1 ... Options: ... --libdir <path> Copy libraries to path. ...
I agree with @shaan7 . The flag
--libdirmeans "Specify a path to store all libraries from
> windeployqt "C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release" --list target --dry-run --libdir "C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib" C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\Qt5Core.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\Qt5Gui.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\Qt5Network.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\Qt5Svg.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\Qt5Widgets.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\libGLESV2.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\libEGL.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\d3dcompiler_47.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\opengl32sw.dll C:\b e s\build-project-Desktop_Qt_5_14_1_MSVC2017_32bit-Profile\release\lib\vc_redist.x86.exe ...