[Interest] To rpath or not when building Qt

Koehne Kai Kai.Koehne at theqtcompany.com
Wed Mar 11 14:54:47 CET 2015


> -----Original Message-----
> From: interest-bounces+kai.koehne=theqtcompany.com at qt-project.org
> [...]
> > The usual approach on unix based systems is to ship a script that runs
> > the executable with the proper library path set. This way you can
> > support multiple install locations which rpath can't do.

Well, you can, as long as the relative path is stable.

> Are the binaries that Qt ships for LINUX built this way?

No, the Qt SDK executables use relative rpaths (as you can easily see running chrpath on one of them).

E.g. qmlscene will find libQt5Quick.so.5 always in $ORIGIN/../lib.

>   I used the "offline"
> installer for Qt 5.4.1 and I can not seem to make a distribution of my
> application. (Asked on another thread). Some blogs seem to hint at adjusting
> the path during the packaging process.

While it's possible to solve the problem with a shell script setting LD_LIBRARY_PATH, this is IMO ugly. I'd also recommend just adapting the rpath using chrpath then.

Regards

Kai



More information about the Interest mailing list