[Qt-interest] Setting library path before running?
Gabriel M. Beddingfield
gabrbedd at gmail.com
Tue Mar 23 02:40:50 CET 2010
On Tue, 23 Mar 2010, Anatoly Burakov wrote:
> I have an app with plugins. They all end up in appropriate directories
> (via DESTDIR), everything works fine, except one thing. On Windows,
> whenever the library is in the same folder - it gets loaded fine, that
> is, i am able to launch my program right from QT Creator. On Linux,
> however, everything works fine except i can't launch the program without
> resorting to manually launching it from command-line (env
> LD_LIBRARY_PATH=/path/to/my/dir). Are there any ways around this without
> setting permanent environment variable in rc files?
Check out 'man ld.so'. Basically, you can either set
LD_LIBRARY_PATH, or...
* put your .so files in /usr/lib or /usr/local/lib.
Run ldconfig after install.
* 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. :-)
HTH,
Gabriel
More information about the Qt-interest-old
mailing list