[Interest] To rpath or not when building Qt
Nikos Chantziaras
realnc at gmail.com
Wed Mar 11 22:58:39 CET 2015
On 11/03/15 23:50, Nikos Chantziaras wrote:
>[...]
> To do that, link with:
>
> -Wl,-rpath=\$ORIGIN/lib,--enable-new-dtags
>
> This will look in the lib subdirectory first for libraries and only
> consider default locations if a library is not found in lib. So if you
> install your main binary in:
>
> /opt/myapp/mybinary
>
> Libraries will be searched in:
>
> /opt/myapp/mybinary/lib
Copy&pasta mistake. It will look in:
/opt/myapp/lib
Note that you can set any relative path to $ORIGIN. Like
"-rpath=\$ORIGIN/../lib", which is the more common case, since you
usually install executables in "/opt/myapp/bin" and libraries in
"/opt/myapp/lib".
More information about the Interest
mailing list