「caffe编译bug」.build_release/lib/libcaffe.so: undefined reference to cv::imread

转自:https://www.douban.com/note/568788483/

CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/lib/libcaffe.so:
undefined reference to cv::imread(cv::String const&, int)‘
.build_release/lib/libcaffe.so: undefined reference
tocv::imencode(cv::String const&, cv::_InputArray const&,
std::vector >&, std::vector > const&)‘
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)‘
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1

solution:

add "opencv_imgcodecs" in Makefile.(LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs)
If
you input "make all",the problem is the same again.But if you delete
all the file in build(rm -rf ./build/*) before "make all"(I use make
clean ),you will success.I just success

github 讨论帖:https://github.com/BVLC/caffe/issues/2348

ps:
build/lib/libcaffe.a(image_io.o):
In function caffe::ReadVideoToVolumeDatum(char const*, int, int, int,
int, int, int, caffe::VolumeDatum*)‘: image_io.cpp:(.text+0x1905):
undefined reference tocv::VideoCapture::VideoCapture()‘
image_io.cpp:(.text+0x1abe):
undefined reference to cv::VideoCapture::open(cv::String const&)‘
image_io.cpp:(.text+0x1ace): undefined reference
tocv::VideoCapture::isOpened() const‘
image_io.cpp:(.text+0x1c91):
undefined reference to cv::VideoCapture::~VideoCapture()‘
image_io.cpp:(.text+0x1d22): undefined reference
tocv::VideoCapture::get(int) const‘
image_io.cpp:(.text+0x1d6d):
undefined reference to cv::VideoCapture::set(int, double)‘
image_io.cpp:(.text+0x1de1): undefined reference
tocv::VideoCapture::set(int, double)‘
image_io.cpp:(.text+0x1e35):
undefined reference to cv::VideoCapture::read(cv::_OutputArray
const&)‘ image_io.cpp:(.text+0x1f7e): undefined reference
tocv::VideoCapture::release()‘
image_io.cpp:(.text+0x1fc3): undefined
reference to cv::VideoCapture::read(cv::_OutputArray const&)‘
image_io.cpp:(.text+0x22e9): undefined reference
tocv::VideoCapture::~VideoCapture()‘
collect2: error: ld returned 1 exit status
make: *** [build/tools/blob_proto_to_blob_binary.bin] Error 1
make: *** Waiting for unfinished jobs....

same solution by adding opencv_videoio to LIBRARIES in the Makefile

原文地址:https://www.cnblogs.com/houjun/p/9982903.html

时间: 2024-10-10 17:36:50

「caffe编译bug」.build_release/lib/libcaffe.so: undefined reference to cv::imread的相关文章

.build_release/lib/libcaffe.so: undefined reference to `cv::VideoCapture::set(int, double)'

CXX/LD -o .build_release/tools/convert_imageset.bin.build_release/lib/libcaffe.so: undefined reference to `cv::VideoCapture::set(int, double)'.build_release/lib/libcaffe.so: undefined reference to `cv::VideoCapture::open(int)'//home/chenwending/anaco

lua-5.2.3编译问题"/usr/local/lib/libreadline.so: undefined reference to `PC'"

作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linux cd src && make linux make[1]: Entering directory `/root/software/lua-5.2.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,

单独编译PCL的kdtree模块报错“undefined reference to”

我打算使用gdb调试pcl的kdtree教程(kdtree_search.cpp).由于pcl经过预编译,将kdtree模块编译成动态链接库.使用gdb无法进入动态链接库进行调试! 因此将kdtree模块(主要为kdtree_flann.h和kdtree_flann.hpp)的相关代码抽取出来,单独编译.代码包的树状图如下所示, 上图可见,kdtree模块的依赖了这么多文件,可见pcl的代码抽象程度,重用性做得非常好. 附上CMakeLists.txt, cmake_minimum_requir

CentOS 6.7 编译PHP7 make时出现错误:undefined reference to `libiconv_close’

编辑Makefile文件,找到变量EXTRA_LIBS,并在末尾添上-liconv EXTRA_LIBS = -lcrypt -lz -lexslt -lcrypt -lrt -lmcrypt -lltdl -lstdc++ -lpng -lz -ljpeg - lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lssl -lcrypto -lcurl -lxml2 -lz -lm -l ssl -lcrypto -lfreetype -lz

【泡咖啡1】linux下caffe编译以及python环境配置手记

caffe是一个深度学习的库,相信搞深度学习的话,不是用这个库就是用theano吧.要想使用caffe首先第一步就是要配置好caffe的环境.在这里,我主要说的是在debian的linux环境下如何配置好caffe的库.因为python编写程序比较方便,在文章最后,我还会具体说明如何配置python环境.本文章为本人原创,部分内容整理自网络,若有不妥之处请联系本人删除.非盈利性质网站转载请在文章开头处著名本文作者:77695,来源http://www.cnblogs.com/cj695/.盈利性

Caffe编译

由于组里项目的问题,需要安装CUDA,之前其他同学弄了一段时间,没有太多关注这些问题.最近才发现,Caffe安装并不正确,因此重新进行了安装. 按照Makefile中的说法,是还需要opencv3.2版本(但是好像没有也可以) 先不安装 依赖库的安装 装其他依赖库glog这个我之前已经验证过了,必须选项 sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev sudo apt-get install libprotobu

lua-5.2.3编译问题记录"libreadline.so: undefined reference to `PC'"

作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linux cd src && make linux make[1]: Entering directory `/root/software/lua-5.2.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,

(笔记)Linux线程编译undefined reference to 'pthread_create'

在使用线程时,使用gcc或arm-linux-gcc编译时,会出现错误:undefined reference to 'pthread_create' 主要是以下两种原因: 1.#include <pthread.h>  请确认头文件是否添加 2.-lpthread 编译选项,即在编译时需添加额外的编译选项,如使用arm-linux-gcc编译lc300-led-test.c文件,命令正确应该如下: arm-linux-gcc -o lc300-led-test lc300-led-test.

[转] Windows+VS2013爆详细Caffe编译安装教程

转 Windows+VS2013爆详细Caffe编译安装教程 1. 安装cuda Cuda是英伟达推出的GPU加速运算平台 我这里安装的是cuda7.5,已经安装过的忽略,还没有安装过的这里有安装教程.windows下面安装还是非常简单的. 点击打开链接    (我的显卡是1080 现在支持cuda8.0 所以我下的是8.0) 2. 下载cuDNN(其实是个压缩包)  注意现在8.0出来了,我下的是cuDNN v5 (May 27, 2016), for CUDA 8.0 RC https://