Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Loading opencv3 Libraries: Not such file or directory

Hi, I recently installed opencv 3 in my computer. I am trying to run a simple video capture and write peogram, but it keep generating errors when running it.

This is my Makefile

  ## ---------- compiler settings ---------- ##

# compiler flags
CFLAGS = -Wall
# compiler 
CC = g++

# compile command
COMP = $(CC) $(CFLAGS)

# ______________________NEW local instalation of opencv3:______________________________________

OPENCV_INCLUDE=-I/usr/include/opencv2/ -I/usr/include/opencv/
OPENCV_LIBS=-L/usr/lib/opencv2/ -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio
#_______________________________________________________________________________________________


## ---------- targets ---------- ##

all: stereo 
stereo: stereo.cpp stereo.h Makefile
    $(COMP) -o $@ $< $(OPENCV_INCLUDE) $(OPENCV_LIBS)

the program builds successfully but when trying to run with:

./stereo -h

I get the error:

./stereo: error while loading shared libraries: libopencv_core.so.3.0: cannot open shared object file: No such file or directory

the file libopencv_core.so.3.0 exists in usr/local/lib

Can anyone help me please?