您的位置:首页 > 产品设计 > UI/UE

.build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)’ .

2017-09-13 14:43 507 查看
我使用的版本是
3.1.0
,在编译工程的时候,遇到如下BUG

...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

...

首先,我是已经配置过了opencv的,可以这样查询安装版本:
$ pkg-config --modversion opencv


因为编译好了,理所当然,输出结果是
3.1.0


所以出现上面的错误,应该是
opencv_imgcodecs
链接的问题,比较有效的解决方案是,把opencv需要的lib添加到
Makefile
文件中,找到
LIBRARIES
(在
PYTHON_LIBRARIES
:= boost_python python2.7
 前一行)并修改为:

LIBRARIES += glog gflags protobuf leveldb snappy \        lmdb boost_system hdf5_hl hdf5 m \        opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐