Reputation: 101
I am compiling my code with
g++ -std=c++11 -I /usr/local/include/opencv4/ recordVideo.cpp -L /usr/local/lib -lopencv_objdetect -lopencv_features2d -lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_videoio
I get error
error while loading shared libraries: libopencv_highgui.so.4.4: cannot open shared object file: No such file or directory
But it is present in /usr/local/lib
as libopencv_highgui.so.4.4
libopencv_highgui.so.4.4.0
Upvotes: 2
Views: 13927
Reputation: 101
solved using link https://github.com/cggos/dip_cvqt/issues/1
Find the folder containing the shared library libopencv_core.so.3.2 using the following command line.
sudo find / -name "libopencv_core.so.3.2*"
Then I got the result: /usr/local/lib/libopencv_core.so.3.2.
2. Create a file called /etc/ld.so.conf.d/opencv.conf and write to it the path to the folder where the binary is stored.For example, I wrote /usr/local/lib/ to my opencv.conf file.
3. Run the command line as follows.
sudo ldconfig -v
Try to run the test binary again.
Upvotes: 3