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. Static Qt dependencies
Forum Updated to NodeBB v4.3 + New Features

Static Qt dependencies

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 1.6k 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.
  • G Offline
    G Offline
    ghleclerc
    wrote on last edited by
    #1

    Hello,

    I am trying to understand what a static Qt build is actually giving me.

    First, some context. My apologies if it's a little long. I work in a hospital. We create in-house software to help with our daily tasks, so we are really our single client ! Because I have little control on the computers used in the hospital (IT has that control, I work in a department as a clinical medical physicist), the simplest approach to all our software deployment has traditionally been to static link everything we can and simply put the executable somewhere on the network and let everybody run that copy.

    I am trying to duplicate that with our latest application, the first one with a GUI using Qt. So I built a static version of Qt5 with quite a few skip commands to get the smallest libraries possible (making sure that what we need is there, of course). Then, I compiled our in-house software and linked statically to Qt (using CMake, don't know if that makes a difference, would think not).

    On first attempts, everything compiled, but nothing linked. I started Googling (normal reaction these days I think ;-) ) and have been for 2 days now. I have figured out that linking to Qt was not enough. I needed to find and link against the system libraries as well, for instance Carbon and Cocoa. [ Note : I work on OSX on my computer for development, but recompile and deploy to Windows for the hospital (thus Qt rocks for me !) ]

    Looking with otool -L, I can see that my executable does not actually link against a Qt library (so static linking of my application to Qt worked) but does require the system libraries (and a few others, but nothing Qt).

    I should also mention that even with the linking properly done, the executable won't work. That though, if I understand correctly, is because of the new platform plugin system.

    My questions are thus the following :

    1. When compiling Qt statically, am I right in saying that the system library symbols are not brought into the archive ? 2) If so, is there a way to bring those symbols in ? My guess is no, but I am no expert.
    2. Is using Qt Deploy supported with statically linked libraries ?
    3. Does someone here know if CMake can be used with Qt Deploy.

    Thanks for your time.

    Ghyslain

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      1. Yes
      2. You don't need to
      3. What to you mean by Qt Deploy ?
      4. IIRC Should be through cpack

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        ghleclerc
        wrote on last edited by
        #3

        Hi,

        Thanks for your answer.

        1. I'm sure there are other ways to achieve my goal. It just seems like creating a completely static application is easier. Does not mean it's achievable, just seems easier. But OK, I don't need to and probably should move on. :-)

        2. Sorry. I hadn't realized that macdeployqt was not a general feature for every platform (i.e. there isn't a windeployqt and lindeployqt). My bad. I gather the only way is through otool, dependency walker and the likes.

        3. I am looking into CPack. Learning curve though, so I was wondering if it was the best solution. Seems it is.

        Well, thanks again for your time.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome,

          1. Depending on how you want to distribute your application bundle on OS X you might hit the Apple rules wall. IIRC they rather like separated dynamic libraries with well defined scope e.g. ui, network etc. Also be aware that static linking has licensing implications.

          2. macdeployqt for OS X (hence the mac), windeployqt exists but having Dependency Walker at hand is better, there's also androiddeployqt IIRC.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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