Ask Your Question
0

Loading opencv3 Libraries: Not such file or directory

asked 2015-06-25 13:59:25 -0600

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?

edit retag flag offensive close merge delete

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 ( 2015-06-25 14:12:26 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-06-26 00:43:40 -0600

updated 2015-06-26 00:43:53 -0600

Try executing following to make it permanent.

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-06-25 13:59:25 -0600

Seen: 2,994 times

Last updated: Jun 26 '15