转自: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

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

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

  2. 「caffe编译bug」 undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11

    CXX/LD -o .build_release/tools/test_net.binCXX/LD -o .build_release/tools/convert_annoset.binCXX/LD ...

  3. 「caffe编译bug」python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory

    在Makefile.config找到PYTHON_INCLUDE,发现有点不同: PYTHON_INCLUDE := /usr/include/python2.7 \         /usr/lib ...

  4. caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.

    when I compile caffe file : .build_debug/lib/libcaffe.so: undefined reference to `cv::imread(cv::Str ...

  5. Opencv undefined reference to `cv::imread() Ubuntu编译

    Ubuntu下编译一个C++文件,C++源程序中使用了opencv,opencv的安装没有问题,但是在编译的过程中出现如下错误: undefined reference to `cv::imread( ...

  6. 编译QT时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法

    lib/libQtGui.so: undefined reference to `ts_read_raw' /lib/libQtGui.so: undefined reference to `ts_o ...

  7. /usr/bin/ld: .build_release/tools/alignment_tools.o: undefined reference to symbol 'omp_get_thread_num@@OMP_1.0'

    问题:/usr/bin/ld: .build_release/tools/alignment_tools.o: undefined reference to symbol 'omp_get_threa ...

  8. (原)编译caffe时提示未定义的引用(undefined reference to)

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5864715.html 参考网址: https://github.com/BVLC/caffe/issu ...

  9. [Linux][C][gcc] Linux GCC 编译链接 报错ex: ./libxxx.so: undefined reference to `shm_open'

    本人原创文章,文章是在此代码github/note的基础上进行补充,转载请注明出处:https://github.com/dramalife/note. 以librt丶用户自定义动态库libxxx 和 ...

随机推荐

  1. NewCaffe

    NewCaffe

  2. 洛谷 P2421 A-B数对(增强版)

    题目描述 给出N 个从小到大排好序的整数,一个差值C,要求在这N个整数中找两个数A 和B,使得A-B=C,问这样的方案有多少种? 例如:N=5,C=2,5 个整数是:2 2 4 8 10.答案是3.具 ...

  3. Glide加载图片并保存到本地返回file,bitmap

    有很多朋友都想要知道32位和64位的区别是什么,因为大家都拿不准自己要装32位系统还是64位系统,因此彷徨是必然的.那么到底区别是啥咧?如果大家想要知道的话,下面就让小编给大家带来32位和64位的区别 ...

  4. 【移动支付】.NET支付宝App支付接入

    一.前言        最近也是为了新产品忙得起飞,博客都更新的慢了.新产品为了方便用户支付,需要支付宝扫码接入.这活落到了我的身上.产品是Windows系统下的桌面软件,通过软件生成二维码支付.界面 ...

  5. 【BZOJ4361】isn(动态规划,容斥)

    [BZOJ4361]isn(动态规划,容斥) 题面 BZOJ 题解 首先我们如果确定了一个不降序列,假设它的长度为\(i\), 那么可行的方案数为\(i*(n-i)!\),但是这样有一些非法的情况,即 ...

  6. C++之面向对象编程20170912

    /*************************************************************************************************** ...

  7. UESTC--1682

    原题链接: 分析:求最小周期的应用. #include<cstdio> #include<cstring> #include<cmath> #include< ...

  8. 多线程中join方法的含义

    1.作用:调用这个方法的时候,主进程会在这里停住,等待该线程进行完毕再继续往下执行. 如:不使用join的情况: <?php class Join extends Thread { public ...

  9. swagger2的常用注解,传递参数的注意使用方法

    背景介绍: 刚开始的时候,在controller层使用@RequestParam的时候,发现这个参数是必须要输入值的,但是我们有时候必须查询的时候允许参数为空,使用这个注解就不行了. 在集成了swag ...

  10. ACE服务端编程3:ACE跨平台之分配堆内存

    ACE服务端编程系列的第三篇,探究ACE解决不同编译器之间分配堆内存的差异. 在ACE的官方示例中会看到大量的ACE_NEW_RETURN,ACE_NEW这样的宏,这是ACE为了消除不同编译器编译的代 ...