Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. External libraries with windeployqt
Qt 6.11 is out! See what's new in the release blog

External libraries with windeployqt

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 5.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shaan7
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shaan7
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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?

          (Z(:^

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mozi
            wrote on last edited by
            #5

            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 --libdir means "Specify a path to store all libraries from windeployqt's deployment".

            > 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
            ...
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved