luisfelip80
(usa Debian)
Enviado em 18/07/2018 - 23:16h
Olá, instalei o Opencv no meu ubuntu para começar a estudar, ir fazendo algumas coisas para aprender. Usei esse tutorial para instalar :
http://www.codebind.com/cpp-tutorial/install-opencv-ubuntu-cpp/
Tudo ok, tirando alguns "Fails" que vi na hora da instalação rapidamente ao decorrer das linhas. Mas ai quando fui testar, fui compilar um código teste que ele dá e me deparei com esse erro gigante, que aparentemente está ligado a erros nos arquivos instalados. Vou colocar apenas parte da mensagem de erro, ela é umas 5 vezes esse tamanho:
Erro: "
/usr/local/include/opencv2/core/mat.inl.hpp:1529:1: error: cv::Mat_<_Tp>::Mat_(int, const int*)
Mat_<_Tp>::Mat_(int _dims, const int* _sz)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1522:1: error: cv::Mat_<_Tp>::Mat_(cv::Size, const _Tp&)
Mat_<_Tp>::Mat_(Size _sz, const _Tp& value)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1517:1: error: cv::Mat_<_Tp>::Mat_(cv::Size)
Mat_<_Tp>::Mat_(Size _sz)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1510:1: error: cv::Mat_<_Tp>::Mat_(int, int, const _Tp&)
Mat_<_Tp>::Mat_(int _rows, int _cols, const _Tp& value)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1504:1: error: cv::Mat_<_Tp>::Mat_(int, int)
Mat_<_Tp>::Mat_(int _rows, int _cols)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1497:1: error: cv::Mat_<_Tp>::Mat_()
Mat_<_Tp>::Mat_()
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/mat.inl.hpp:2005:39: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat_<_Tp>& Mat_<_Tp>::operator = (Mat_&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘cv::Mat_<_Tp>& cv::Mat_<_Tp>::operator=(cv::Mat_<_Tp>)’:
/usr/local/include/opencv2/core/mat.inl.hpp:2007:22: error: ‘move’ is not a member of ‘std’
Mat::operator = (std::move(m));
^
/usr/local/include/opencv2/core/mat.inl.hpp:2007:32: error: ‘m’ was not declared in this scope
Mat::operator = (std::move(m));
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:2012:20: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat_<_Tp>::Mat_(Mat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::Mat_<_Tp>::Mat_(cv::Mat)’:
/usr/local/include/opencv2/core/mat.inl.hpp:2016:13: error: ‘m’ was not declared in this scope
*this = m;
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:2020:38: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat_<_Tp>& Mat_<_Tp>::operator = (Mat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘cv::Mat_<_Tp>& cv::Mat_<_Tp>::operator=(cv::Mat)’:
/usr/local/include/opencv2/core/mat.inl.hpp:2022:37: error: ‘m’ was not declared in this scope
if( traits::Type<_Tp>::value == m.type() )
^
/usr/local/include/opencv2/core/mat.inl.hpp:2024:30: error: expected primary-expression before ‘&&’ token
Mat::operator = ((Mat&&)m);
^
/usr/local/include/opencv2/core/mat.inl.hpp:2024:32: error: expected primary-expression before ‘)’ token
Mat::operator = ((Mat&&)m);
^
/usr/local/include/opencv2/core/mat.inl.hpp:2027:38: error: ‘m’ was not declared in this scope
if( traits::Depth<_Tp>::value == m.depth() )
^
/usr/local/include/opencv2/core/mat.inl.hpp:2029:30: error: expected primary-expression before ‘&&’ token
Mat::operator = ((Mat&&)m.reshape(DataType<_Tp>::channels, m.dims, 0));
^
/usr/local/include/opencv2/core/mat.inl.hpp:2029:32: error: expected primary-expression before ‘)’ token
Mat::operator = ((Mat&&)m.reshape(DataType<_Tp>::channels, m.dims, 0));
^
/usr/local/include/opencv2/core/mat.inl.hpp:2033:5: error: ‘m’ was not declared in this scope
m.convertTo(*this, type());
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:2038:24: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat_<_Tp>::Mat_(MatExpr&& e)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::Mat_<_Tp>::Mat_(cv::MatExpr)’:
/usr/local/include/opencv2/core/mat.inl.hpp:2042:17: error: ‘e’ was not declared in this scope
*this = Mat(e);
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘void cv::UMat::assignTo(cv::UMat&, int) const’:
/usr/local/include/opencv2/core/mat.inl.hpp:3689:11: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::UMat’ and ‘const cv::UMat’)
m = *this;
^
/usr/local/include/opencv2/core/mat.inl.hpp:3615:7: note: candidate: cv::UMat& cv::UMat::operator=(const cv::UMat&)
UMat& UMat::operator = (const UMat& m)
^
In file included from /usr/local/include/opencv2/core.hpp:59:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/mat.hpp:2531:11: note: candidate: cv::UMat& cv::UMat::operator=(cv::UMat)
UMat& operator = (UMat&& m);
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:3818:16: error: expected ‘,’ or ‘...’ before ‘&&’ token
UMat::UMat(UMat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3818:1: error: prototype for ‘cv::UMat::UMat(cv::UMat)’ does not match any in class ‘cv::UMat’
UMat::UMat(UMat&& m)
^
In file included from /usr/local/include/opencv2/core.hpp:59:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/mat.hpp:2404:37: error: candidates are: template<class _Tp> cv::UMat::UMat(const cv::MatCommaInitializer_<_Tp>&)
template<typename _Tp> explicit UMat(const MatCommaInitializer_<_Tp>& comma
^
/usr/local/include/opencv2/core/mat.hpp:2402:37: error: template<class _Tp> cv::UMat::UMat(const cv::Point3_<_Tp>&, bool)
template<typename _Tp> explicit UMat(const Point3_<_Tp>& pt, bool copyData=
^
/usr/local/include/opencv2/core/mat.hpp:2400:37: error: template<class _Tp> cv::UMat::UMat(const cv::Point_<_Tp>&, bool)
template<typename _Tp> explicit UMat(const Point_<_Tp>& pt, bool copyData=t
^
/usr/local/include/opencv2/core/mat.hpp:2398:51: error: template<class _Tp, int m, int n> cv::UMat::UMat(const cv::Matx<_Tp, m, n>&, bool)
template<typename _Tp, int m, int n> explicit UMat(const Matx<_Tp, m, n>& m
^
/usr/local/include/opencv2/core/mat.hpp:2396:44: error: template<class _Tp, int n> cv::UMat::UMat(const cv::Vec<_Tp, m>&, bool)
template<typename _Tp, int n> explicit UMat(const Vec<_Tp, n>& vec, bool co
^
/usr/local/include/opencv2/core/mat.hpp:2393:37: error: template<class _Tp> cv::UMat::UMat(const std::vector<_Tp>&, bool)
template<typename _Tp> explicit UMat(const std::vector<_Tp>& vec, bool copy
^
/usr/local/include/opencv2/core/mat.hpp:2391:5: error: cv::UMat::UMat(const cv::UMat&, const std::vector<cv::Range>&)
UMat(const UMat& m, const std::vector<Range>& ranges);
^
/usr/local/include/opencv2/core/mat.hpp:2390:5: error: cv::UMat::UMat(const cv::UMat&, const cv::Range*)
UMat(const UMat& m, const Range* ranges);
^
/usr/local/include/opencv2/core/mat.hpp:2389:5: error: cv::UMat::UMat(const cv::UMat&, const Rect&)
UMat(const UMat& m, const Rect& roi);
^
/usr/local/include/opencv2/core/mat.hpp:2388:5: error: cv::UMat::UMat(const cv::UMat&, const cv::Range&, const cv::Range&)
UMat(const UMat& m, const Range& rowRange, const Range& colRange=Range::all
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/mat.inl.hpp:3581:1: error: cv::UMat::UMat(const cv::UMat&)
UMat::UMat(const UMat& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3573:1: error: cv::UMat::UMat(int, const int*, int, const Scalar&, cv::UMatUsageFlags)
UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s, UMatUsageFla
^
/usr/local/include/opencv2/core/mat.inl.hpp:3566:1: error: cv::UMat::UMat(int, const int*, int, cv::UMatUsageFlags)
UMat::UMat(int _dims, const int* _sz, int _type, UMatUsageFlags _usageFlags)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3558:1: error: cv::UMat::UMat(cv::Size, int, const Scalar&, cv::UMatUsageFlags)
UMat::UMat(Size _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3543:1: error: cv::UMat::UMat(int, int, int, const Scalar&, cv::UMatUsageFlags)
UMat::UMat(int _rows, int _cols, int _type, const Scalar& _s, UMatUsageFlags _u
^
/usr/local/include/opencv2/core/mat.inl.hpp:3551:1: error: cv::UMat::UMat(cv::Size, int, cv::UMatUsageFlags)
UMat::UMat(Size _sz, int _type, UMatUsageFlags _usageFlags)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3536:1: error: cv::UMat::UMat(int, int, int, cv::UMatUsageFlags)
UMat::UMat(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3531:1: error: cv::UMat::UMat(cv::UMatUsageFlags)
UMat::UMat(UMatUsageFlags _usageFlags)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3842:29: error: expected ‘,’ or ‘...’ before ‘&&’ token
UMat& UMat::operator = (UMat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘cv::UMat& cv::UMat::operator=(cv::UMat)’:
/usr/local/include/opencv2/core/mat.inl.hpp:3844:18: error: ‘m’ was not declared in this scope
if (this == &m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:3847:13: error: ‘m’ was not declared in this scope
flags = m.flags; dims = m.dims; rows = m.rows; cols = m.cols;
^
In file included from /usr/local/include/opencv2/core.hpp:3281:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/utility.hpp: At global scope:
/usr/local/include/opencv2/core/utility.hpp:549:10: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void(const Range&)> m_functor;
^
/usr/local/include/opencv2/core/utility.hpp:551:48: error: expected ‘)’ before ‘<’ token
ParallelLoopBodyLambdaWrapper(std::function<void(const Range&)> functor) :
^
/usr/local/include/opencv2/core/utility.hpp: In member function ‘virtual void cv::ParallelLoopBodyLambdaWrapper::operator()(const cv::Range&) const’:
/usr/local/include/opencv2/core/utility.hpp:557:24: error: ‘m_functor’ was not declared in this scope
m_functor(range);
^
/usr/local/include/opencv2/core/utility.hpp: At global scope:
/usr/local/include/opencv2/core/utility.hpp:561:52: error: ‘std::function’ has not been declared
inline void parallel_for_(const Range& range, std::function<void(const Range&)>
^
/usr/local/include/opencv2/core/utility.hpp:561:60: error: expected ‘,’ or ‘...’ before ‘<’ token
inline void parallel_for_(const Range& range, std::function<void(const Range&)>
^
/usr/local/include/opencv2/core/utility.hpp: In function ‘void cv::parallel_for_(const cv::Range&, int)’:
/usr/local/include/opencv2/core/utility.hpp:563:56: error: ‘functor’ was not declared in this scope
parallel_for_(range, ParallelLoopBodyLambdaWrapper(functor), nstripes);
^
/usr/local/include/opencv2/core/utility.hpp:563:66: error: ‘nstripes’ was not declared in this scope
parallel_for_(range, ParallelLoopBodyLambdaWrapper(functor), nstripes);
^
/usr/local/include/opencv2/core/utility.hpp: At global scope:
/usr/local/include/opencv2/core/utility.hpp:665:14: error: ‘recursive_mutex’ in namespace ‘std’ does not name a type
typedef std::recursive_mutex Mutex;
^
/usr/local/include/opencv2/core/utility.hpp:666:14: error: ‘lock_guard’ in namespace ‘std’ does not name a template type
typedef std::lock_guard<cv::Mutex> AutoLock;
^
main.cpp: In function ‘int main(int, char**)’:
main.cpp:7:38: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
image = cv::imread("sample.jpeg" , CV_LOAD_IMAGE_COLOR);
^
In file included from /usr/local/include/opencv2/core.hpp:60:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/persistence.hpp: In instantiation of ‘void cv::read(const cv::FileNode&, cv::Point_<_Tp>&, const cv::Point_<_Tp>&) [with _Tp = int]’:
/usr/local/include/opencv2/core/persistence.hpp:782:34: required from here
/usr/local/include/opencv2/core/persistence.hpp:737:11: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Point_<int>’ and ‘const cv::Point_<int>’)
value = temp.size() != 2 ? default_value : Point_<_Tp>(saturate_cast<_Tp>(t
^
In file included from /usr/local/include/opencv2/core.hpp:58:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/types.hpp:1177:14: note: candidate: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = int]
Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
^
/usr/local/include/opencv2/core/types.hpp:1184:14: note: candidate: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(cv::Point_<_Tp>) [with _Tp = int; cv::Point_<_Tp> = cv::Point_<int>]
Point_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) CV_NOEXCEPT
^
/usr/local/include/opencv2/core/types.hpp: In instantiation of ‘static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const cv::KeyPoint*; _OI = cv::KeyPoint*]’:
/usr/include/c++/5/bits/stl_algobase.h:402:44: required from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const cv::KeyPoint*; _OI = cv::KeyPoint*]’
/usr/include/c++/5/bits/stl_algobase.h:438:45: required from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const cv::KeyPoint*, std::vector<cv::KeyPoint> >; _OI = __gnu_cxx::__normal_iterator<cv::KeyPoint*, std::vector<cv::KeyPoint> >]’
/usr/include/c++/5/bits/stl_algobase.h:471:8: required from ‘_OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const cv::KeyPoint*, std::vector<cv::KeyPoint> >; _OI = __gnu_cxx::__normal_iterator<cv::KeyPoint*, std::vector<cv::KeyPoint> >]’
/usr/include/c++/5/bits/vector.tcc:206:31: required from ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = cv::KeyPoint; _Alloc = std::allocator<cv::KeyPoint>]’
/usr/local/include/opencv2/core/persistence.hpp:1158:13: required from here
/usr/local/include/opencv2/core/types.hpp:711:27: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Point2f {aka cv::Point_<float>}’ and ‘const Point2f {aka const cv::Point_<float>}’)
class CV_EXPORTS_W_SIMPLE KeyPoint
^
In file included from /usr/local/include/opencv2/core.hpp:58:0,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/local/include/opencv2/core/types.hpp:170:13: note: candidate: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(const cv::Point_<_Tp>&) [with _Tp = float]
Point_& operator = (const Point_& pt);
^
/usr/local/include/opencv2/core/types.hpp:171:13: note: candidate: cv::Point_<_Tp>& cv::Point_<_Tp>::operator=(cv::Point_<_Tp>) [with _Tp = float; cv::Point_<_Tp> = cv::Point_<float>]
Point_& operator = (Point_&& pt) CV_NOEXCEPT;
^
In file included from /usr/include/c++/5/algorithm:61:0,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/highgui.hpp:46,
from main.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:340:18: note: synthesized method ‘cv::KeyPoint& cv::KeyPoint::operator=(const cv::KeyPoint&)’ first required here
*__result = *__first;
^
"