Building Qt as static libraries and linking on RedHat 7.2
-
@Simon-Platten said in Building Qt as static libraries and linking on RedHat 7.2:
No problem, what I would like is a packager that identifies what libraries are required, grabs them and packages then into an installer that we can use for installations and be assured that nothing is missing.
That's the thing, you shouldn't ... it's sounds counterintuitive I know, but Linux distros have their own repository and in that repository there's Qt, to which you should stick. Qt is binary compatible just for that reason, the API is allowed to (breakingly) change only between major versions, which means that things developed with Qt 5.0 should work out of the box if you just substitute the target of the
libQt5Core.so
symbolic link fromlibQt5Core.so.5.0.0
tolibQt5Core.so.5.7.0
. You can deploy Qt binaries as well, but it starts to get really painful if there's a change in one of the underlying libraries the Qt platform integration plugins depend on. Same problem with static builds, you can't build the kernel API statically, right, plus you get one big monster executable and you need to initialize the plugins Qt uses manually from code (which Qt does automagically when the loader loads the corresponding .so). Just my 2 cents.If you still decide to walk the "deploy Qt binaries" way then the Qt documentation provides a relatively comprehensive text, as you've already found out, on how to do it.
-
Now I'm confused, what are you saying...I have built at least 4 RedHat 7.2 systems and none of these had the Qt shared object libraries after the install. This is why we are looking at static builds.
I've just relinked our application with the static libraries and I get:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".Reinstalling the application may fix this problem.
Aborted (core dumped)[Edit] I've run ldd on the application and noted the referneced libraries, I added all these to the project but it still comes up with the same error.
-
@Simon-Platten said in Building Qt as static libraries and linking on RedHat 7.2:
none of these had the Qt shared object libraries after the install.
Have you installed Qt from the distribution's repository? I work on Debian (testing), here's what I have for Qt, all precompiled and ready to be installed.
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".As I said, with static linkage the plugins must be loaded from code.
Look here and here for more info. It should be enough to add:
CONFIG += static
for your application, so I'd start there.
Kind regards.
-
Thank you, will look into this....
hmm...I found one post from last year:
https://blog.qt.io/blog/2015/06/24/qt-is-coming-to-red-hat-enterprise-linux/
However there isn't any recent activity on this and I'm not sure that Qt5.6 libraries are available from any repositories.
-
@Simon-Platten said in Building Qt as static libraries and linking on RedHat 7.2:
However there isn't any recent activity on this and I'm not sure that Qt5.6 libraries are available from any repositories.
I can't say, sorry. You may be right that there isn't a prebuilt binary, I never cared much for the RedHat family, so I'm not up to date.
-
I have no choice the company I'm contracting to required a licensed version of Linux.
-
@Simon-Platten said in Building Qt as static libraries and linking on RedHat 7.2:
I have no choice the company I'm contracting to required a licensed version of Linux.
I didn't mean to imply that you should switch, I only meant that I am not up to date with RedHat and what it provides.
-
Thats ok, no offence taken :)