External libraries with windeployqt

  • 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.

  • Moderators

    Try using --libdir flag. Or just copy the DLL into C:\Qt\5.3\mingw482_32\bin

  • 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?

  • Moderators

    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?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.