libopencv_core.so.3.1: cannot open shared object file: No such file or directory
I was trying to run an OpenCV
-based code which was compiled using Cmake and make. I have OpenCV 3.4.7
installed, but I don't know why when running the executable, it picks on the version:
error while loading shared libraries: libopencv_core.so.3.1: cannot open shared object file: No such file or directory
I see the followings are already in /usr/local/lib
:
/usr/local/lib/libopencv_core.so.4.1.1
/usr/local/lib/libopencv_core.so
/usr/local/lib/libopencv_core.so.3.4
/usr/local/lib/libopencv_core.so.4.1
/usr/local/lib/libopencv_core.so.3.4.7
How to solve this problem? Why it looks for only 3.1
? Where does this number come from?!
I guess the version 3.1 is hardcode in your makefile or Cmake file.
This should help:
It apparently comes from Caffe.so which I built from source. I don't see anything hardcoded. And i did the command... nothing changed on those shared libs.
btw, should I run
sudo ldconfig -v
before cmake/make of caffe?Not sure but you may try some following step:
when using the "ldconfig -v" , you may see something like:
(not sure what would be in the left. just take an example)
in your sample, you want "libopencv_core.so.3.4.7", not "libopencv_core.so.3.1"
remove the symbolic link of libopencv_core.so.3.0 by
add the symbolic link by
now type the "ldconfig -v " again to check the if the link is what you want.
hope it would not crush your computer. I'm not familiar with this.
I actually have 3.4.7 installed, but the sample needs 3.1. Isn't it the reverse of what you said? One thing I did was to copy/rename 3.4.7 under the 3.1 name in
usr/local/lib
. Will it generally work?!