红联Linux门户
Linux帮助

Ubuntu安装opencv后编译出现connot find -lopencv_imgcodecs

发布时间:2017-09-13 10:44:03来源:linux网站作者:IT远征军
Ubuntu 14.04 安装opencv3.0后,caffe编译出现connot find -lopencv_imgcodecs的解决方式:
 
先将Makefile.config文件中
OPENCV_VERSION :=
3 注释掉,只修改USE_OPENCV := 1
 
修改后的结果:
USE_OPENCV := 1
#OPENCV_VERSION := 3
 
在caffe根目录下,找到Makefile文件,打开文件
查找“Derive include and lib directories”一节,修改“LIBRARIES +=”的最后一行(LIBRARIES +=opencv_imgcodecs ),增加opencv_imgcodecs
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
(此时应该变为LIBRARIES += opencv_imgcodecs  opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs)
保存,退出。
 
注意:在做前边的基础工作是将Makefile.config文件中
OPENCV_VERSION :=
3 注释掉,只修改USE_OPENCV := 1
 
再在caffe目录下,sudo make all -j8一下,问题解决
# Uncomment
if you're using OpenCV 3OPENCV_VERSION :=
3
# Uncomment
if you're using OpenCV 3OPENCV_VERSION :=
3
 
本文永久更新地址:http://www.linuxdiyf.com/linux/32589.html