When create executable or dynamic library, sometimes they need to depends on third-party shared library, so how system find the third-party shared library and how can you make sure the system find the right version of library instead of some library in same name?

Solution could be pack the correct third-party library with your executable or library, but how to let system find the packed library? most platform has search directory list to find dependent libraries, even you put the third-party library in the same directory, the system still could find wrong one.

So on Linux/Unix like system RPATH will be the solution, on Mac system install-name of third-party library will be the key.

Below is web-pages talking about install-name and RPATH: