[Qt-interest] Setting library path before running?

Paul Floyd paulf at free.fr
Tue Mar 23 18:15:44 CET 2010


Quoting "Gabriel M. Beddingfield" <gabrbedd at gmail.com>:

>
>
> On Tue, 23 Mar 2010, Anatoly Burakov wrote:
>
> Check out 'man ld.so'.  Basically, you can either set
> LD_LIBRARY_PATH, or...

If you must, put it in a shell script wrapper. And even then, any sub-processes
that you start will probably be lumbered with your LD_LIBRARY_PATH.

> * put your .so files in /usr/lib or /usr/local/lib.
>    Run ldconfig after install.

That sounds just like everyone putting their DLLs in c:\windows\system32.

> * put your .so files somewhere else and put the
>    path in ld.so.conf.  Run ldconfig.
>
> * load your shared libraries via dlopen... but
>    you probably don't want to do this. :-)

* use RPATH (with $ORIGIN if necessary). This is THE decent and nice way of
doing it. The only restriction is for apps that need high security, but then the
horrors like LD_LIBRARY_PATH are in the same boat.

A+
Paul
-- 
Paul Floyd   http://paulf.free.fr



More information about the Qt-interest-old mailing list