Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bundling Libraries with Qt Application
Qt 6.12 LTS is out! See what's new in the release blog

Bundling Libraries with Qt Application

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 4.4k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I am making a Qt Application for Windows and Linux, I have a question,
    I am using Qt LGPL license which is dynamic.
    How can I bundle the dependencies(libraries) other then Qt libraries with my executable for both Windows and Linux?
    Also is it possible to do so if I am using LGPL license?

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

      On Windows it's quite easy, just copy the .dll files together with your executable. On Linux, due to security reasons and a different system philosophy, using system libs is preferred. If you insist on bundling, you can do it, but need to set the environment prior to launching your app (namely, LD_LIBRARY_PATH). Take a look at how Qt Creator is working on both platforms - it bundles all libs it uses with it, so it's exactly the scenario you want, isn't it?

      AFAIK, you are allowed to copy and distribute the libraries with your app. You are required to publish any changes to LGPLed libraries (that does not mean your application or other libs you create yourself - just ones that are bound by LGPL. For example, if you have patched QString for your app, you have to publish that patch).

      (Z(:^

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hi,

        Thanks for the reply,
        What I want to do is build a Qt static Application which bundles the dependencies in itself other then Qt libraries.

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

          Uh, static is different. There is much discussion about that, but I think the general consensus (tm) is that Qt cannot be included statically under LGPL. But you keep referring to "other libraries" - what do you mean by that? Qt's licensing has nothing to do with other libraries, you have to abide their licenses if you want to include them in your project. Those 2 things are independent.

          (Z(:^

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Hi,

            Actually I know that I can't build static Qt Applications under LGPL license, but what my problem is, in linux when I run my executable on another linux machine it gives me error related to many dependencies(Qt libraries and other system libraries), so I thought to bundle the system libraries in my executable and distribute the Qt libraries with my Application, so this way I am not violating Qt's LGPL license.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              It depends on the lisence of your own application. If your own application is GPL, you might use that. That allows static building. Static building using the Qt LGPL version is dark-grey territory. You have to provide a way to re-link your code to another version of the libraries. If you don't provide sources, that means at least distributing object files. However, opions differ on the question if that is sufficient.

              If you have a closed source application and you want to use static linking, I would recommend you contact Digia for a commercial license on Qt.

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

                In general on Linux it's better to use package manager - so a RPM or a DEB. Alternatively - again - take a look into Qt Creator, it does bundle it's libs. Be careful though, as Andre said this is tricky stuff from legal point of view.

                (Z(:^

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Hi,

                  I don't want to statically build Qt libraries, I just want to statically build the system libraries, for eg: libz

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

                    So what is still not clear here for you? Both me and Andre have given answers to all of your questions, as far as I can see.

                    If you want to compile system libs and the license permits you to do that - feel free to do it.

                    (Z(:^

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