ubuntu opencv Error: cannot open shared object file: no such file or directory

20 篇文章 0 订阅
4 篇文章 0 订阅

you may have correctly installed Opencv and built your projects,  but when you run the application or debug it,  such error will take place

TO SOVLE IT

first, make sure your  shared libs can be found  under  the directory /usr/local/lib

then you should make  a declaration of  the lib's directory in a configuration file, its name should be like /etc/ld.so.conf.d/xxx.conf


for example:

my opencv have installed in /usr/local/opencv

then I should create a configuration file and edit it as following

cd /etc/ld.so.conf.d/
touch opencv.conf
vim opencv.conf
/usr/local/opencv

to make sure it will work,  use the command to print all the shared libs . Do you find them ?

sudo ldconfig -v | grep opencv
my output is :
	libopencv_photo.so.2.4 -> libopencv_photo.so.2.4.10
	libopencv_video.so.2.4 -> libopencv_video.so.2.4.10
	libopencv_calib3d.so.2.4 -> libopencv_calib3d.so.2.4.10
	libopencv_contrib.so.2.4 -> libopencv_contrib.so.2.4.10
	libopencv_flann.so.2.4 -> libopencv_flann.so.2.4.10
	libopencv_superres.so.2.4 -> libopencv_superres.so.2.4.10
	libopencv_ml.so.2.4 -> libopencv_ml.so.2.4.10
	libopencv_highgui.so.2.4 -> libopencv_highgui.so.2.4.10
	libopencv_features2d.so.2.4 -> libopencv_features2d.so.2.4.10
	libopencv_imgproc.so.2.4 -> libopencv_imgproc.so.2.4.10
	libopencv_nonfree.so.2.4 -> libopencv_nonfree.so.2.4.10
	libopencv_stitching.so.2.4 -> libopencv_stitching.so.2.4.10
	libopencv_objdetect.so.2.4 -> libopencv_objdetect.so.2.4.10
	libopencv_videostab.so.2.4 -> libopencv_videostab.so.2.4.10
	libopencv_legacy.so.2.4 -> libopencv_legacy.so.2.4.10
	libopencv_ocl.so.2.4 -> libopencv_ocl.so.2.4.10
	libopencv_core.so.2.4 -> libopencv_core.so.2.4.10
	libopencv_gpu.so.2.4 -> libopencv_gpu.so.2.4.10
Good luck ~



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值