Caffe: ERROR:Undefined symbols for architecture x86_64

Created on 15 Feb 2017  路  3Comments  路  Source: BVLC/caffe

When I install caffe in my macbook pro ,there is a problem.

[ 75%] Linking CXX shared library ../../lib/libcaffe.dylib
Undefined symbols for architecture x86_64:
  "cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      caffe::WindowDataLayer<float>::load_batch(caffe::Batch<float>*) in window_data_layer.cpp.o
      caffe::WindowDataLayer<double>::load_batch(caffe::Batch<double>*) in window_data_layer.cpp.o
      caffe::ReadImageToCVMat(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, bool) in io.cpp.o
  "cv::imencode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
      caffe::ReadImageToDatum(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, caffe::Datum*) in io.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libcaffe.1.0.0-rc4.dylib] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

Can anyone meet similar question?
HOW CAN I FIX IT?
Want HELP!!!

System configuration

Operating system:MACOS 10.12.3
Compiler:clang
CUDA version (if applicable):no (cpu only)
CUDNN version (if applicable):no
BLAS:
Python or MATLAB version (for pycaffe and matcaffe respectively):python

Most helpful comment

I had the same issue using opencv3. Uncommenting OPENCV_VERSION := 3 seems to have fixed it.

All 3 comments

Have you got your OpenCV in the right place?

And please seek for such help through Caffe user mailing list next time. It might distract developers from bug reports and feature requests.

I had the same issue using opencv3. Uncommenting OPENCV_VERSION := 3 seems to have fixed it.

From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:

_Please do not post usage, installation, or modeling questions, or other requests for help to Issues._
Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

Was this page helpful?
0 / 5 - 0 ratings