Correct Way to Export Multiple Ld_Library_Paths

LD_LIBRARY_PATH won't work with more than one path

I guess you would like to check the value of $LD_LIBRARY_PATH.

use

echo $LD_LIBRARY_PATH

Otherwise bash would thought you asked it to execute a command stored in $LD_LIBRARY_PATH.

Why do I have to define LD_LIBRARY_PATH with an export every time I run my application?

Use

export LD_LIBRARY_PATH="/path/to/library/"

in your .bashrc otherwise, it'll only be available to bash and not any programs you start.

Try -R/path/to/library/ flag when you're linking, it'll make the program look in that directory and you won't need to set any environment variables.

EDIT: Looks like -R is Solaris only, and you're on Linux.

An alternate way would be to add the path to /etc/ld.so.conf and run ldconfig. Note that this is a global change that will apply to all dynamically linked binaries.

Why changing LD_LIBRARY_PATH has no effect in Ubuntu?

If you look at the output of your ls -al

ls -al output

These are soft links that you have. Your softlink libQt5MultimediaWidgets.so.5 points to libQt5MultimediaWidgets.so.5.9.2 in the same directory and the file is not there at all. So you need to either set the correct softlink path or have the file in same directory



Related Topics



Leave a reply



Submit