Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

libopencv_core.so.4.1 not found?

i have installed openCV and i have

>     ls local/lib/
>     cmake                       libopencv_dnn.so.4.1          
> libopencv_gapi.so          
> libopencv_imgcodecs.so.4.1.2 
> libopencv_objdetect.so.4.1   
> libopencv_videoio.so
>     libopencv_calib3d.so        libopencv_dnn.so.4.1.2        
> libopencv_gapi.so.4.1      
> libopencv_imgproc.so         
> libopencv_objdetect.so.4.1.2 
> libopencv_videoio.so.4.1
>     libopencv_calib3d.so.4.1    libopencv_features2d.so       
> libopencv_gapi.so.4.1.2    
> libopencv_imgproc.so.4.1     
> libopencv_photo.so           
> libopencv_videoio.so.4.1.2
>     libopencv_calib3d.so.4.1.2  libopencv_features2d.so.4.1   
> libopencv_highgui.so       
> libopencv_imgproc.so.4.1.2   
> libopencv_photo.so.4.1       
> libopencv_video.so
>     libopencv_core.so           libopencv_features2d.so.4.1.2 
> libopencv_highgui.so.4.1   
> libopencv_ml.so              
> libopencv_photo.so.4.1.2     
> libopencv_video.so.4.1
>     libopencv_core.so.4.1       libopencv_flann.so            
> libopencv_highgui.so.4.1.2 
> libopencv_ml.so.4.1          
> libopencv_stitching.so       
> libopencv_video.so.4.1.2
>     libopencv_core.so.4.1.2     libopencv_flann.so.4.1        
> libopencv_imgcodecs.so     
> libopencv_ml.so.4.1.2        
> libopencv_stitching.so.4.1   
> python2.7
>     libopencv_dnn.so            libopencv_flann.so.4.1.2      
> libopencv_imgcodecs.so.4.1 
> libopencv_objdetect.so       
> libopencv_stitching.so.4.1.2 
> python3.6

in my lib folder, now i am compilin it using

g++ main.cpp -I/home/matulmat/local/include/opencv4/ -L/home/matulmat/local/lib /home/matulmat/local/lib/*.so.*

and it compiles, but running it with

./a.out

returns

./a.out: error while loading shared libraries: libopencv_core.so.4.1: cannot open shared object file: No such file or directory

... but file libopencv_core.so.4.1 is in directory!. I tried linkin it usin -l

g++ main.cpp -I/home/matulmat/local/include/opencv4/ -L/home/matulmat/local/lib -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_core.so.4.1

but it returned

cannot find -llibopencv_core.so.4.1

.. Why is this happeningg? How can i fix it? It seems its impossible to make openCV work...

Thanks for help!