.build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)’ .
2017-09-13 14:43
507 查看
我使用的版本是
...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的,可以这样查询安装版本:
因为编译好了,理所当然,输出结果是
所以出现上面的错误,应该是
LIBRARIES += glog gflags protobuf leveldb snappy \ lmdb boost_system hdf5_hl hdf5 m \ opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
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
相关文章推荐
- build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)'
- Caffe .build_release/lib/libcaffe.so:对‘cv::imread(cv::String const&, int)’未定义的引用
- caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.
- Opencv3.0: undefined reference to cv::imread(cv::String const&, int)
- error: undefined reference to `cv::imread(cv::String const&, int)'问题解决方法
- undefined reference to cv::imread(cv::String const&, int)
- undefined reference to `cv::imread(cv::String const&, int)'
- undefined reference to cv::imread(cv::String const&, int)
- libhighgui.so: undefined reference to `cvCreateCameraCapture_V4L(int)'
- ubuntu16.04下编译caffe出现.build_release/lib/libcaffe.so: undefined reference to google ::protobuf...的问题
- caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.
- 编译QT时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法
- ../thelib/libthelib.so: undefined reference to `dlopen'
- Caffe 工程的一些编译错误以及解决方案(undefined reference to cv::imread)
- /lib/libQtGui.so: undefined reference to `ts_read_raw'
- caffe 编译/usr/local/lib/libopencv_highgui.so: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'
- fedora 15 安装opencv2.2时出现undefined reference to `cvCreateCameraCapture_V4L(int)'问题及其解决方法
- FreeBSD下编译Fontconfig时提示src/.libs/libfontconfig.so: undefined reference to `xmlCreatePushParserCtxt' 的解决办法
- undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)
- Ubuntu11.20 32位linux下编译cppunit报 libcppunit.so: undefined reference to `dlsym'错误问题