ldd does not find path, How to add

if your libraries are not on standard path then either you need to add them to the path or add non-standard path to LD_LIBRARY_PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<Your_non-Standard_path>

Once you done any one of above things then you need to update the dynamic linker run-time binding by executing below command:

sudo ldconfig

UPDATE:

You can make the changes permanent by either writing the above export line into one of your startup files (e.g. ~/.bashrc) OR if the underlying library is not conflicting with any other library then put into one of standard library path (e.g. /lib,/usr/lib)


LD_LIBRARY_PATH is suitable for short tests, but since there is only one variable, it is awkward to use when you might have multiple applications with custom libraries.

The usual way for Debian/Ubuntu is to add it to the loader's configuration, e.g., a file under

/etc/ld.so.conf.d

containing the directory in which you want the loader to search, e.g.,

/usr/local/libcsfml

Further reading:

  • ldconfig - configure dynamic linker run-time bindings
  • ld.so, ld-linux.so* - dynamic linker/loader
  • Why LD_LIBRARY_PATH is bad

This looks as if the binary in question was compiled by you.

So you are responsible for the problem that some libraries cannot be found.

In case that these libraries are available on your system, they seem to be located in non-standard directory locations.

Use -R directory for the final compiler call to tell the linker the directory where the libraries are located. More than a single -R directory option is possible.

Note that when you are using gcc, you may need to use -Wl,-R instead of -R.