error while loading shared libraries [How to Solve]

When running the program, the following errors occur:

 error while loading shared libraries: libXXXXXXX.so.1: cannot open shared object file: No such file or directory

1. First open the/etc/ld.so.conf file

2. Add the directory where the dynamic library file is located: execute VI/etc/ld.so.conf, and add “/usr/local/lib” under “include LD.So.Conf.d/*.Conf”.

3. After saving, execute:/SBIN/ldconfig – V on the command line terminal; Its function is to cache the library files under the path listed in the file/etc/ld.so.conf to/etc/ld.so.cache for use. Therefore, when some library files are installed or/etc/ld.so.conf is modified to add a new search path for the library, it is necessary to run ldconfig to cache all library files into the file/etc/ld.so.cache. If it is not done, the newly installed library may not be found.

Read More: