Where does Ubuntu look for shared libraries?
This whole path business is related to something called multi-arch. Basically it's to allow you to have 32bit and 64bit libraries on the same system.
After you copied the file, did you happen to run ldconfig?
ldconfig creates, updates, and removes the necessary links and cache
(for use by the run-time linker, ld.so) to the most recent shared
libraries found in the directories specified on the command line, in
the file /etc/ld.so.conf, and in the trusted directories (/usr/lib and
/lib). ldconfig checks the header and file names of the libraries it
encounters when determining which versions should have their links
updated. ldconfig ignores symbolic links when scanning for libraries.
The information contained in the above question AND first (and only ATT) answer, helped me resolve *a similar * issue of mine on WSL Ubuntu (on Win10 64)!
In my case the executable couldn't find a library.
I ultimately noticed that the newly-made library got positioned in /usr/lib64
, but the multi-arch lines of /etc/ld.so.conf.d/x86_64-linux-gnu.conf
did not include that directory.
So I ran
sudo ldconfig /usr/lib64
and that finally fixed it. (running it alone without the directory parameter did not make it 'magically' find the libraries BTW.) It's unclear whether 'restarting' my WSL bash helped... I think that wasn't even needed.