In file included from /usr/local/include/opencv/cxcore.hpp:2307: /usr/local/include/opencv/cxoperations.hpp:1254:15: error: no viable overloaded '=' r = Range(0, d.size()); ~ ^ ~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/opencv/cxcore.h:1826: /usr/local/include/opencv/cxcore.hpp:438:18: note: candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'cv::Range const', but method is not marked const class CV_EXPORTS Range ^ In file included from /usr/local/include/opencv/cxcore.h:1826: In file included from /usr/local/include/opencv/cxcore.hpp:2308: /usr/local/include/opencv/cxmat.hpp:2978:12: error: no viable conversion from 'MatExpr_' to 'MatExpr_ >, cv::Mat>' return MatExpr_(MatExpr_Temp( ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/opencv/cxmat.hpp:777:51: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'MatExpr_' to 'cv::MatExpr_, int, cv::Mat, cv::MatOp_BinS_ >, cv::Mat> const &' for 1st argument template class CV_EXPORTS MatExpr_ : public MatExpr_Base_ ^ /usr/local/include/opencv/cxmat.hpp:780:5: note: candidate constructor not viable: no known conversion from 'MatExpr_' to 'cv::MatExpr_Op3_, int, cv::Mat, cv::MatOp_BinS_ > const &' for 1st argument MatExpr_(const E& _e) : e(_e) {} ^ /usr/local/include/opencv/cxmat.hpp:782:5: note: candidate function operator M() const { return (M)e; } ^ /usr/local/include/opencv/cxmat.hpp:3956:14: error: call to non-static member function without an object argument Mat::operator = (m); ~~~~~^~~~~~~~ 3 errors generated.