zoukankan      html  css  js  c++  java
  • 「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

  • 相关阅读:
    套接口编程
    传输层
    1 简介
    共享池2
    jquery.dataTables列中内容居中问题?求解?
    bootstrap-multiselect.js多选下拉框初始化时默认选中初始值
    datatable 动态显示/隐藏列
    bootstrap table 主子表 局部数据刷新(刷新子表)
    bootstrap table 怎么实现前两列固定冻结?
    bootstrapTable表格表头换行
  • 原文地址:https://www.cnblogs.com/houjun/p/9982903.html
Copyright © 2011-2022 走看看