latest caffe version failes with error undefined reference to `cv::imread(cv::String const&, int)'

2,377 views
Skip to first unread message

Hossein Hasanpour

unread,
Feb 22, 2016, 6:48:24 AM2/22/16
to Caffe Users
I am trying to compile and use the latest version of caffe , but I'm getting these errors

AR -o .build_release/lib/libcaffe.a
LD
-o .build_release/lib/libcaffe.so.1.0.0-rc3
CXX tools
/caffe.cpp
CXX
/LD -o .build_release/tools/caffe.bin
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `
cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > 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/caffe.bin] Error 1


I downloaded caffe almost a month a go and that compiled just fine! but this one that I downloaded today! gives these errors:

I tried the hongzhenwang solution here  but that didnt work for me!
Whats wrong and how can I get rid of these errors?


by the way I installed opencv using this command on ubuntu 14.04 :
 sudo apt-get install libopencv-dev


Thanks in advance

Hossein Hasanpour

unread,
Feb 23, 2016, 1:59:42 AM2/23/16
to Caffe Users
Ok, since I had installed anaconda, and then ran its update (which resulted in installing opencv3 ), it somehow made opencv3 the default.
Therefor I had to specify I'm using Opencv 3 in makefile.config.
and then add the anaconda lib to the bashrc. so that all goes fine.
for those having the same problem, check this link : https://github.com/BVLC/caffe/issues/3700
Remember that You still need to follow hongzhenwang solution.
hope this helps some one else out there.
Reply all
Reply to author
Forward
0 new messages