conflicts between usr/lib, usr/local/lib and BLAKE2

I'm using a SEMECS library, a dependency is the libb2 BLACK2 library, I installed this library and it was installed successfully, but it was in usr/local/lib and it seems that SEMECS looks for it in usr/lib, so it generates the following error

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

1

1 Answer

Set the LD_LIBRARY_PATH environment variable. This is similar to $PATH, but for locating shared libraries.

Commonly, this is set in ~/.bashrc :

export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"

There is also the ldd command that lets you check what shared libs a binary uses (and from what paths):

ldd myprogram

e.g.

[sh @ balrog] ~ 7 % ldd /bin/ls linux-vdso.so.1 (0x00007ffcdd75b000) libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007fa9ab768000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fa9ab540000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa9ab14f000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa9aaf4b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa9aad2c000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa9aaaba000) /lib64/ld-linux-x86-64.so.2 (0x00007fa9abb91000)

Finally, there is ldconfig that recreates the linker cache for shared libraries; that is useful when you just built a new shared lib, and it might not be in the cache yet:

sudo ldconfig
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like