our own linux binary find/recognize in /usr/local/lib

How do we have our own linux binary find, recognize and use its library/deps. in local library i.e. in /usr/local/lib as we install it itself in /usr/local/bin ?
Dynamic linker has a search path that it looks from when loading executable. The /usr/local/lib might be already configured into it (among other paths). That config is system-wide.

You can pass additional entries to the dynamic linker's search path via environment. (LD_LIBRARY_PATH)

When you link executable, you can give the linker option to encode a path into the executable so that dynamic linker does not have to search.
Registered users can post here. Sign in or register to post.