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.
3) Is using Qt Deploy supported with statically linked libraries ?
4) Does someone here know if CMake can be used with Qt Deploy.
Thanks for your time.
Ghyslain
↧