First time here? Check out the FAQ!

Ask Your Question
0

Loading opencv3 Libraries: Not such file or directory

asked Jun 25 '15

CataRAy gravatar image

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?

Preview: (hide)

Comments

it seems to work temporarly if i add

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

is there any way to make this permanent?

CataRAy gravatar imageCataRAy (Jun 25 '15)edit

1 answer

Sort by » oldest newest most voted
2

answered Jun 26 '15

updated Jun 26 '15

Try executing following to make it permanent.

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
Preview: (hide)

Question Tools

2 followers

Stats

Asked: Jun 25 '15

Seen: 3,093 times

Last updated: Jun 26 '15