Unable to Build OpenCV project in eclipse CDT C++ - c++

Hello I am having issues getting my opencv setup and working with Eclipse and C++. I have my paths linked correctly and included libraries set up correctly, I have it working on my laptop so I am sure of this. When I try and build a project with just having #include as the only OpenCV code I get these errors.
UMat(UMat&& m);
^
/usr/local/include/opencv2/core/mat.hpp:2531:27: error: expected ‘,’ or ‘...’ before ‘&&’ token
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 ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘void cv::_InputArray::init(int, const void*, cv::Size)’:
/usr/local/include/opencv2/core/mat.inl.hpp:70:41: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Size {aka cv::Size_<int>}’ and ‘cv::Size {aka cv::Size_<int>}’)
{ flags = _flags; obj = (void*)_obj; sz = _sz; }
^
In file included from /usr/local/include/opencv2/core.hpp:58:0,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/types.hpp:1707:13: note: candidate: cv::Size_<_Tp>& cv::Size_<_Tp>::operator=(const cv::Size_<_Tp>&) [with _Tp = int]
Size_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz)
^
/usr/local/include/opencv2/core/types.hpp:1714:13: note: candidate: cv::Size_<_Tp>& cv::Size_<_Tp>::operator=(cv::Size_<_Tp>) [with _Tp = int]
Size_<_Tp>& Size_<_Tp>::operator = (Size_<_Tp>&& sz) CV_NOEXCEPT
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:88:37: error: ‘array’ in namespace ‘std’ does not name a template type
_InputArray::_InputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:88:42: error: expected ‘,’ or ‘...’ before ‘<’ token
_InputArray::_InputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:89:86: error: ‘arr’ was not declared in this scope
{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_READ, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:92:37: error: ‘array’ in namespace ‘std’ does not name a template type
_InputArray::_InputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:92:42: error: expected ‘,’ or ‘...’ before ‘<’ token
_InputArray::_InputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:93:37: error: ‘arr’ was not declared in this scope
{ init(STD_ARRAY_MAT + ACCESS_READ, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:175:33: error: ‘cv::_OutputArray::_OutputArray’ declared as an ‘inline’ variable
_OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:175:33: error: ‘int cv::_OutputArray::_OutputArray’ is not a static data member of ‘class cv::_OutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:175:33: error: template definition of non-template ‘int cv::_OutputArray::_OutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:175:28: error: ‘array’ is not a member of ‘std’
_OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:175:42: error: expected primary-expression before ‘,’ token
_OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:175:50: error: ‘arr’ was not declared in this scope
_OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:179:33: error: ‘cv::_OutputArray::_OutputArray’ declared as an ‘inline’ variable
_OutputArray::_OutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:179:33: error: ‘int cv::_OutputArray::_OutputArray’ is not a static data member of ‘class cv::_OutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:179:33: error: template definition of non-template ‘int cv::_OutputArray::_OutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:179:28: error: ‘array’ is not a member of ‘std’
_OutputArray::_OutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:179:42: error: expected primary-expression before ‘,’ token
_OutputArray::_OutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:179:50: error: ‘arr’ was not declared in this scope
_OutputArray::_OutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:215:39: error: ‘array’ in namespace ‘std’ does not name a template type
_OutputArray::_OutputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:215:44: error: expected ‘,’ or ‘...’ before ‘<’ token
_OutputArray::_OutputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:216:87: error: ‘arr’ was not declared in this scope
{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:219:39: error: ‘array’ in namespace ‘std’ does not name a template type
_OutputArray::_OutputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:219:44: error: expected ‘,’ or ‘...’ before ‘<’ token
_OutputArray::_OutputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:220:51: error: ‘arr’ was not declared in this scope
{ init(FIXED_SIZE + STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:290:43: error: ‘cv::_InputOutputArray::_InputOutputArray’ declared as an ‘inline’ variable
_InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:290:43: error: ‘int cv::_InputOutputArray::_InputOutputArray’ is not a static data member of ‘class cv::_InputOutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:290:43: error: template definition of non-template ‘int cv::_InputOutputArray::_InputOutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:290:38: error: ‘array’ is not a member of ‘std’
_InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:290:52: error: expected primary-expression before ‘,’ token
_InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:290:60: error: ‘arr’ was not declared in this scope
_InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:294:43: error: ‘cv::_InputOutputArray::_InputOutputArray’ declared as an ‘inline’ variable
_InputOutputArray::_InputOutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:294:43: error: ‘int cv::_InputOutputArray::_InputOutputArray’ is not a static data member of ‘class cv::_InputOutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:294:43: error: template definition of non-template ‘int cv::_InputOutputArray::_InputOutputArray’
/usr/local/include/opencv2/core/mat.inl.hpp:294:38: error: ‘array’ is not a member of ‘std’
_InputOutputArray::_InputOutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:294:52: error: expected primary-expression before ‘,’ token
_InputOutputArray::_InputOutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:294:60: error: ‘arr’ was not declared in this scope
_InputOutputArray::_InputOutputArray(std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:325:49: error: ‘array’ in namespace ‘std’ does not name a template type
_InputOutputArray::_InputOutputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:325:54: error: expected ‘,’ or ‘...’ before ‘<’ token
_InputOutputArray::_InputOutputArray(const std::array<_Tp, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:326:84: error: ‘arr’ was not declared in this scope
{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:329:49: error: ‘array’ in namespace ‘std’ does not name a template type
_InputOutputArray::_InputOutputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp:329:54: error: expected ‘,’ or ‘...’ before ‘<’ token
_InputOutputArray::_InputOutputArray(const std::array<Mat, _Nm>& arr)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:330:48: error: ‘arr’ was not declared in this scope
{ init(FIXED_SIZE + STD_ARRAY_MAT + ACCESS_RW, arr.data(), Size(1, _Nm)); }
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:562:21: error: ‘initializer_list’ in namespace ‘std’ does not name a template type
Mat::Mat(const std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:562:37: error: expected ‘,’ or ‘...’ before ‘<’ token
Mat::Mat(const std::initializer_list<_Tp> list)
^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::Mat::Mat(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:565:5: error: ‘list’ was not declared in this scope
CV_Assert(list.size() != 0);
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp:566:14: error: ‘list’ was not declared in this scope
Mat((int)list.size(), 1, traits::Type<_Tp>::value, (uchar*)list.begin()).copyTo(*this);
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:570:21: error: ‘initializer_list’ in namespace ‘std’ does not name a template type
Mat::Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:570:37: error: expected ‘,’ or ‘...’ before ‘<’ token
Mat::Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::Mat::Mat(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:574:14: error: ‘s’ does not name a type
for(auto s : sizes)
^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: expected ‘;’ before ‘do’
CV_Assert(list.size() != 0);
^
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: expected primary-expression before ‘do’
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: expected ‘;’ before ‘do’
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: expected primary-expression before ‘do’
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: expected ‘)’ before ‘do’
/usr/local/include/opencv2/core/mat.inl.hpp:576:5: error: ‘list’ was not declared in this scope
CV_Assert(list.size() != 0);
^
/usr/local/include/opencv2/core/mat.inl.hpp:577:5: error: ‘list’ was not declared in this scope
CV_Assert(size_total == list.size());
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp:578:14: error: ‘sizes’ was not declared in this scope
Mat((int)sizes.size(), (int*)sizes.begin(), traits::Type<_Tp>::value, (uchar*)list.begin()).copyTo(*this);
^
/usr/local/include/opencv2/core/mat.inl.hpp:578:83: error: ‘list’ was not declared in this scope
Mat((int)sizes.size(), (int*)sizes.begin(), traits::Type<_Tp>::value, (uchar*)list.begin()).copyTo(*this);
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:582:21: error: ‘array’ in namespace ‘std’ does not name a template type
Mat::Mat(const std::array<_Tp, _Nm>& arr, bool copyData)
^
/usr/local/include/opencv2/core/mat.inl.hpp:582:26: error: expected ‘,’ or ‘...’ before ‘<’ token
Mat::Mat(const std::array<_Tp, _Nm>& arr, bool copyData)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In constructor ‘cv::Mat::Mat(int)’:
/usr/local/include/opencv2/core/mat.inl.hpp:583:90: error: ‘arr’ was not declared in this scope
: flags(MAGIC_VAL | traits::Type<_Tp>::value | CV_MAT_CONT_FLAG), dims(2), rows((int)arr.size()),
^
/usr/local/include/opencv2/core/mat.inl.hpp:588:10: error: ‘copyData’ was not declared in this scope
if( !copyData )
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘void cv::Mat::assignTo(cv::Mat&, int) const’:
/usr/local/include/opencv2/core/mat.inl.hpp:762:11: error: ambiguous overload for ‘operator=’ (operand types are ‘cv::Mat’ and ‘const cv::Mat’)
m = *this;
^
/usr/local/include/opencv2/core/mat.inl.hpp:686:6: note: candidate: cv::Mat& cv::Mat::operator=(const cv::Mat&)
Mat& Mat::operator = (const Mat& m)
^
In file included from /usr/local/include/opencv2/core.hpp:59:0,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.hpp:2060:10: note: candidate: cv::Mat& cv::Mat::operator=(cv::Mat)
Mat& operator = (Mat&& m);
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:1249:20: error: ‘array’ in namespace ‘std’ does not name a template type
Mat::operator std::array<_Tp, _Nm>() const
^
/usr/local/include/opencv2/core/mat.inl.hpp:1323:13: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat::Mat(Mat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1323:1: error: prototype for ‘cv::Mat::Mat(cv::Mat)’ does not match any in class ‘cv::Mat’
Mat::Mat(Mat&& m)
^
In file included from /usr/local/include/opencv2/core.hpp:59:0,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.hpp:1021:14: error: candidates are: cv::Mat::Mat(const cv::cuda::GpuMat&)
explicit Mat(const cuda::GpuMat& m);
^
/usr/local/include/opencv2/core/mat.hpp:1018:37: error: template<class _Tp> cv::Mat::Mat(const cv::MatCommaInitializer_<_Tp>&)
template<typename _Tp> explicit Mat(const MatCommaInitializer_<_Tp>& commaInitializer);
^
/usr/local/include/opencv2/core/mat.hpp:1014:37: error: template<class _Tp> cv::Mat::Mat(const cv::Point3_<_Tp>&, bool)
template<typename _Tp> explicit Mat(const Point3_<_Tp>& pt, bool copyData=true);
^
/usr/local/include/opencv2/core/mat.hpp:1010:37: error: template<class _Tp> cv::Mat::Mat(const cv::Point_<_Tp>&, bool)
template<typename _Tp> explicit Mat(const Point_<_Tp>& pt, bool copyData=true);
^
/usr/local/include/opencv2/core/mat.hpp:1006:51: error: template<class _Tp, int m, int n> cv::Mat::Mat(const cv::Matx<_Tp, m, n>&, bool)
template<typename _Tp, int m, int n> explicit Mat(const Matx<_Tp, m, n>& mtx, bool copyData=true);
^
/usr/local/include/opencv2/core/mat.hpp:1002:44: error: template<class _Tp, int n> cv::Mat::Mat(const cv::Vec<_Tp, m>&, bool)
template<typename _Tp, int n> explicit Mat(const Vec<_Tp, n>& vec, bool copyData=true);
^
/usr/local/include/opencv2/core/mat.hpp:997:49: error: template<class _Tp, long unsigned int _Nm> cv::Mat::Mat(int)
template<typename _Tp, size_t _Nm> explicit Mat(const std::array<_Tp, _Nm>& arr, bool copyData=false);
^
/usr/local/include/opencv2/core/mat.hpp:992:37: error: template<class _Tp> cv::Mat::Mat(int)
template<typename _Tp> explicit Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list);
^
/usr/local/include/opencv2/core/mat.hpp:988:14: error: template<class _Tp, class> cv::Mat::Mat(int)
explicit Mat(const std::initializer_list<_Tp> list);
^
/usr/local/include/opencv2/core/mat.hpp:983:37: error: template<class _Tp> cv::Mat::Mat(const std::vector<_Tp>&, bool)
template<typename _Tp> explicit Mat(const std::vector<_Tp>& vec, bool copyData=false);
^
/usr/local/include/opencv2/core/mat.hpp:965:5: error: cv::Mat::Mat(const cv::Mat&, const std::vector<cv::Range>&)
Mat(const Mat& m, const std::vector<Range>& ranges);
^
/usr/local/include/opencv2/core/mat.hpp:955:5: error: cv::Mat::Mat(const cv::Mat&, const cv::Range*)
Mat(const Mat& m, const Range* ranges);
^
/usr/local/include/opencv2/core/mat.hpp:945:5: error: cv::Mat::Mat(const cv::Mat&, const Rect&)
Mat(const Mat& m, const Rect& roi);
^
/usr/local/include/opencv2/core/mat.hpp:935:5: error: cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)
Mat(const Mat& m, const Range& rowRange, const Range& colRange=Range::all());
^
/usr/local/include/opencv2/core/mat.hpp:923:5: error: cv::Mat::Mat(const std::vector<int>&, int, void*, const size_t*)
Mat(const std::vector<int>& sizes, int type, void* data, const size_t* steps=0);
^
/usr/local/include/opencv2/core/mat.hpp:909:5: error: cv::Mat::Mat(int, const int*, int, void*, const size_t*)
Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0);
^
In file included from /usr/local/include/opencv2/core/mat.hpp:3657:0,
from /usr/local/include/opencv2/core.hpp:59,
from ../src/HomeworkTwo.cpp:10:
/usr/local/include/opencv2/core/mat.inl.hpp:515:1: error: cv::Mat::Mat(cv::Size, int, void*, size_t)
Mat::Mat(Size _sz, int _type, void* _data, size_t _step)
^
/usr/local/include/opencv2/core/mat.inl.hpp:486:1: error: cv::Mat::Mat(int, int, int, void*, size_t)
Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step)
^
/usr/local/include/opencv2/core/mat.inl.hpp:467:1: error: cv::Mat::Mat(const cv::Mat&)
Mat::Mat(const Mat& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:458:1: error: cv::Mat::Mat(const std::vector<int>&, int, const Scalar&)
Mat::Mat(const std::vector<int>& _sz, int _type, const Scalar& _s)
^
/usr/local/include/opencv2/core/mat.inl.hpp:441:1: error: cv::Mat::Mat(int, const int*, int, const Scalar&)
Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s)
^
/usr/local/include/opencv2/core/mat.inl.hpp:450:1: error: cv::Mat::Mat(const std::vector<int>&, int)
Mat::Mat(const std::vector<int>& _sz, int _type)
^
/usr/local/include/opencv2/core/mat.inl.hpp:433:1: error: cv::Mat::Mat(int, const int*, int)
Mat::Mat(int _dims, const int* _sz, int _type)
^
/usr/local/include/opencv2/core/mat.inl.hpp:424:1: error: cv::Mat::Mat(cv::Size, int, const Scalar&)
Mat::Mat(Size _sz, int _type, const Scalar& _s)
^
/usr/local/include/opencv2/core/mat.inl.hpp:407:1: error: cv::Mat::Mat(int, int, int, const Scalar&)
Mat::Mat(int _rows, int _cols, int _type, const Scalar& _s)
^
/usr/local/include/opencv2/core/mat.inl.hpp:416:1: error: cv::Mat::Mat(cv::Size, int)
Mat::Mat(Size _sz, int _type)
^
/usr/local/include/opencv2/core/mat.inl.hpp:399:1: error: cv::Mat::Mat(int, int, int)
Mat::Mat(int _rows, int _cols, int _type)
^
/usr/local/include/opencv2/core/mat.inl.hpp:393:1: error: cv::Mat::Mat()
Mat::Mat()
^
/usr/local/include/opencv2/core/mat.inl.hpp:1348:26: error: expected ‘,’ or ‘...’ before ‘&&’ token
Mat& Mat::operator = (Mat&& m)
^
/usr/local/include/opencv2/core/mat.inl.hpp: In member function ‘cv::Mat& cv::Mat::operator=(cv::Mat)’:
/usr/local/include/opencv2/core/mat.inl.hpp:1350:18: error: ‘m’ was not declared in this scope
if (this == &m)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1354:13: error: ‘m’ was not declared in this scope
flags = m.flags; dims = m.dims; rows = m.rows; cols = m.cols; data = m.data;
^
/usr/local/include/opencv2/core/mat.inl.hpp: At global scope:
/usr/local/include/opencv2/core/mat.inl.hpp:1628:22: error: ‘cv::Mat_<_Tp>::Mat_’ declared as an ‘inline’ variable
Mat_<_Tp>::Mat_(std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1628:22: error: ‘int cv::Mat_<_Tp>::Mat_’ is not a static data member of ‘class cv::Mat_<_Tp>’
/usr/local/include/opencv2/core/mat.inl.hpp:1628:22: error: template definition of non-template ‘int cv::Mat_<_Tp>::Mat_’
/usr/local/include/opencv2/core/mat.inl.hpp:1628:17: error: ‘initializer_list’ is not a member of ‘std’
Mat_<_Tp>::Mat_(std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1628:42: error: expected primary-expression before ‘>’ token
Mat_<_Tp>::Mat_(std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1628:44: error: ‘list’ was not declared in this scope
Mat_<_Tp>::Mat_(std::initializer_list<_Tp> list)
^
/usr/local/include/opencv2/core/mat.inl.hpp:1633:28: error: ‘initializer_list’ in namespace ‘std’ does not name a template type
Mat_<_Tp>::Mat_(const std::initializer_list<int> sizes, std::initializer_list<_Tp> list)

Related

Open CV installation issues. Mingw problems c++ error

after using cmake on my opencv build folder, I used cmd to run mingw32-make and got the following error.
In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:14,
from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:18:5: error: 'LogLevel' does not name a type
LogLevel level;
^~~~~~~~
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:20:38: error: 'LogLevel' has not been declared
inline LogTag(const char* _name, LogLevel _level)
^~~~~~~~
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp: In constructor 'cv::utils::logging::LogTag::LogTag(const char*, int)':
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:22:11: error: class 'cv::utils::logging::LogTag' does not have any field named 'level'
, level(_level)
^~~~~
In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:15,
from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:20:5: error: 'LogLevel' does not name a type
LogLevel level;
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:34:48: error: 'LogLevel' has not been declared
LogTagConfig(const std::string& _namePart, LogLevel _level, bool _isGlobal = false,
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: In constructor 'cv::utils::logging::LogTagConfig::LogTagConfig()':
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:27:11: error: class 'cv::utils::logging::LogTagConfig' does not have any field named 'level'
, level()
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: In constructor 'cv::utils::logging::LogTagConfig::LogTagConfig(const string&, int, bool, bool, bool)':
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:37:11: error: class 'cv::utils::logging::LogTagConfig' does not have any field named 'level'
, level(_level)
^~~~~
In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:24:32: error: expected ')' before 'defaultUnconfiguredGlobalLevel'
LogTagConfigParser(LogLevel defaultUnconfiguredGlobalLevel = LOG_LEVEL_VERBOSE);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:40:49: error: 'LogLevel' has not been declared
void parseWildcard(const std::string& name, LogLevel level);
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:41:22: error: 'LogLevel' was not declared in this scope
static std::pair<LogLevel, bool> parseLogLevel(const std::string& s);
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:41:36: error: template argument 1 is invalid
static std::pair<LogLevel, bool> parseLogLevel(const std::string& s);
^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:42:33: error: 'LogLevel' has not been declared
static std::string toString(LogLevel level);
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:12:39: error: expected constructor, destructor, or type conversion before '(' token
LogTagConfigParser::LogTagConfigParser(LogLevel defaultUnconfiguredGlobalLevel)
^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In member function 'void cv::utils::logging::LogTagConfigParser::parseNameAndLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:105:25: error: request for member 'second' in 'parsedLevel', which is of non-class type 'int'
if (parsedLevel.second)
^~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:108:43: error: request for member 'first' in 'parsedLevel', which is of non-class type 'int'
parseWildcard("", parsedLevel.first);
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:132:21: error: request for member 'second' in 'parsedLevel', which is of non-class type 'int'
if (parsedLevel.second)
^~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:134:59: error: request for member 'first' in 'parsedLevel', which is of non-class type 'int'
parseWildcard(s.substr(0u, colonIdx), parsedLevel.first);
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:146:65: error: 'LogLevel' has not been declared
void LogTagConfigParser::parseWildcard(const std::string& name, LogLevel level)
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In member function 'void cv::utils::logging::LogTagConfigParser::parseWildcard(const string&, int)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:152:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
m_parsedGlobal.level = level;
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:158:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
m_parsedGlobal.level = level;
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:164:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
m_parsedGlobal.level = level;
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:175:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
m_parsedGlobal.level = level;
^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:193:11: error: 'LogLevel' was not declared in this scope
std::pair<LogLevel, bool> LogTagConfigParser::parseLogLevel(const std::string& s)
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:193:25: error: template argument 1 is invalid
std::pair<LogLevel, bool> LogTagConfigParser::parseLogLevel(const std::string& s)
^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In static member function 'static int cv::utils::logging::LogTagConfigParser::parseLogLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:195:47: error: 'LOG_LEVEL_VERBOSE' was not declared in this scope
const auto falseDontCare = std::make_pair(LOG_LEVEL_VERBOSE, false);
^~~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:195:47: note: suggested alternative: 'CV_LOG_LEVEL_VERBOSE'
const auto falseDontCare = std::make_pair(LOG_LEVEL_VERBOSE, false);
^~~~~~~~~~~~~~~~~
CV_LOG_LEVEL_VERBOSE
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:40: error: 'LogLevel' has not been declared
const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:67: error: 'LogLevel' was not declared in this scope
const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:67: note: suggested alternative: 'parseLogLevel'
const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
^~~~~~~~
parseLogLevel
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:81: error: template argument 1 is invalid
const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In lambda function:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:198:40: error: cannot convert 'std::pair<int, bool>' to 'int' in return
return std::make_pair(lev, true);
^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In static member function 'static int cv::utils::logging::LogTagConfigParser::parseLogLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:209:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:209:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:216:43: error: 'LOG_LEVEL_DEBUG' was not declared in this scope
return make_parsed_result(LOG_LEVEL_DEBUG);
^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:216:43: note: suggested alternative: 'CV_LOG_LEVEL_DEBUG'
return make_parsed_result(LOG_LEVEL_DEBUG);
^~~~~~~~~~~~~~~
CV_LOG_LEVEL_DEBUG
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:221:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:221:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:228:43: error: 'LOG_LEVEL_ERROR' was not declared in this scope
return make_parsed_result(LOG_LEVEL_ERROR);
^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:228:43: note: suggested alternative: 'CV_LOG_LEVEL_ERROR'
return make_parsed_result(LOG_LEVEL_ERROR);
^~~~~~~~~~~~~~~
CV_LOG_LEVEL_ERROR
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:235:43: error: 'LOG_LEVEL_FATAL' was not declared in this scope
return make_parsed_result(LOG_LEVEL_FATAL);
^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:235:43: note: suggested alternative: 'CV_LOG_LEVEL_FATAL'
return make_parsed_result(LOG_LEVEL_FATAL);
^~~~~~~~~~~~~~~
CV_LOG_LEVEL_FATAL
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:242:43: error: 'LOG_LEVEL_INFO' was not declared in this scope
return make_parsed_result(LOG_LEVEL_INFO);
^~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:242:43: note: suggested alternative: 'CV_LOG_LEVEL_INFO'
return make_parsed_result(LOG_LEVEL_INFO);
^~~~~~~~~~~~~~
CV_LOG_LEVEL_INFO
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:248:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:248:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:255:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:255:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
return make_parsed_result(LOG_LEVEL_SILENT);
^~~~~~~~~~~~~~~~
CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:271:43: error: 'LOG_LEVEL_WARNING' was not declared in this scope
return make_parsed_result(LOG_LEVEL_WARNING);
^~~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:271:43: note: suggested alternative: 'CV_LOG_LEVEL_WARN'
return make_parsed_result(LOG_LEVEL_WARNING);
^~~~~~~~~~~~~~~~~
CV_LOG_LEVEL_WARN
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: error: 'std::__cxx11::string cv::utils::logging::LogTagConfigParser::toString' is not a static data member of 'class cv::utils::logging::LogTagConfigParser'
std::string LogTagConfigParser::toString(LogLevel level)
^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: error: 'LogLevel' was not declared in this scope
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: note: suggested alternative: 'parseLogLevel'
std::string LogTagConfigParser::toString(LogLevel level)
^~~~~~~~
parseLogLevel
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:283:1: error: expected ',' or ';' before '{' token
{
^
mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1258: modules/core/CMakeFiles/opencv_core.dir/src/utils/logtagconfigparser.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2318: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
mingw32-make: *** [Makefile:182: all] Error 2
Please how do i solve this, and what is LogLevel?.
At first i was using Mingw then i ran into a "mutex" issue.So i changed to Mingw64 to solve it, the I arrived at this problem. Is there a library I'm missing cause I havent found what LogLevel is.

Error when using TensorFlow C++ API

Here are what I've Done:
(1)build tensorflow from source(with bazel)
(2)build eigen from source
(3)build protobuf from souce
(4)copy bazel-genfiles, tensorflow, third_party to workdir/include/tf
(5)copy eigen3 to workdir/include
(6)compile my cpp file in workdir with:g++ -std=c++11 -o -I./include/tf -I./include/eigen3 -I./include/tf/bazel-genfiles DeepLearningModel.cpp
And here are what I got:
In file included from ./include/tf/tensorflow/core/framework/allocator.h:25:0,
from ./include/tf/tensorflow/core/framework/tensor.h:20,
from ./include/tf/tensorflow/core/public/session.h:24,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
./include/tf/tensorflow/core/framework/type_traits.h:69:52: error: ‘half’ is not a member of ‘Eigen’
std::is_trivial<T>::value || std::is_same<T, Eigen::half>::value ||
^
./include/tf/tensorflow/core/framework/type_traits.h:69:52: error: ‘half’ is not a member of ‘Eigen’
./include/tf/tensorflow/core/framework/type_traits.h:69:63: error: template argument 2 is invalid
std::is_trivial<T>::value || std::is_same<T, Eigen::half>::value ||
^
DeepLearningModel.cpp: In member function ‘int DNNModel::decode_from_hex(char*, InputFeature&)’:
DeepLearningModel.cpp:58:34: error: ‘Tensorhape’ is not a member of ‘tensorflow’
Tensor x(tensorflow::DT_DOUBLE, tensorflow::Tensorhape({input.batch_size, input.timestep, input.feature_len}));
^
DeepLearningModel.cpp:61:22: error: ‘InputFeature {aka struct sInputFeature}’ has no member named ‘batch’
for(int i=0;i<input.batch;i++){
^
DeepLearningModel.cpp: In member function ‘int DNNModel::predict(const char*, int&)’:
DeepLearningModel.cpp:101:55: error: no matching function for call to ‘DNNModel::decode_from_hex(const char*&, InputFeature*)’
int status_decode = decode_from_hex(input_hex, &input);
^
DeepLearningModel.cpp:42:5: note: candidate: int DNNModel::decode_from_hex(char*, InputFeature&)
int DNNModel::decode_from_hex(char *input_hex, InputFeature &input){
^
DeepLearningModel.cpp:42:5: note: no known conversion for argument 2 from ‘InputFeature* {aka sInputFeature*}’ to ‘InputFeature& {aka sInputFeature&}’
DeepLearningModel.cpp:106:7: error: expected unqualified-id before ‘<’ token
std::<vector<std::pair<std::string, tensorflow:Tensor> > input_vec;
^
DeepLearningModel.cpp:106:8: error: ‘vector’ was not declared in this scope
std::<vector<std::pair<std::string, tensorflow:Tensor> > input_vec;
^
DeepLearningModel.cpp:106:8: note: suggested alternatives:
In file included from /usr/include/c++/5/vector:64:0,
from ./include/tf/tensorflow/core/public/session.h:20,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
/usr/include/c++/5/bits/stl_vector.h:214:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^
/usr/include/c++/5/bits/stl_vector.h:214:11: note: ‘std::vector’
DeepLearningModel.cpp:106:55: error: template argument 2 is invalid
std::<vector<std::pair<std::string, tensorflow:Tensor> > input_vec;
^
DeepLearningModel.cpp:106:59: error: ‘input_vec’ was not declared in this scope
std::<vector<std::pair<std::string, tensorflow:Tensor> > input_vec;
^
DeepLearningModel.cpp:107:31: error: missing template arguments before ‘,’ token
input_vec.push_back(std::pair,std::string, tensorflow::Tensor> >(&input_node, input.data));
^
DeepLearningModel.cpp:107:43: error: expected primary-expression before ‘,’ token
input_vec.push_back(std::pair,std::string, tensorflow::Tensor> >(&input_node, input.data));
^
DeepLearningModel.cpp:107:63: error: expected primary-expression before ‘>’ token
input_vec.push_back(std::pair,std::string, tensorflow::Tensor> >(&input_node, input.data));
^
DeepLearningModel.cpp:107:65: error: expected primary-expression before ‘>’ token
input_vec.push_back(std::pair,std::string, tensorflow::Tensor> >(&input_node, input.data));
^
In file included from ./include/eigen3/unsupported/Eigen/CXX11/Tensor:113:0,
from ./include/tf/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
from ./include/tf/tensorflow/core/framework/tensor.h:19,
from ./include/tf/tensorflow/core/public/session.h:24,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h: In instantiation of ‘Eigen::TensorMap<PlainObjectType, Options_>::Scalar& Eigen::TensorMap<PlainObjectType, Options_>::operator()(Eigen::TensorMap<PlainObjectType, Options_>::Index, IndexTypes ...) [with IndexTypes = {int}; PlainObjectType = Eigen::Tensor<double, 1, 1, long int>; int Options_ = 16; Eigen::TensorMap<PlainObjectType, Options_>::Scalar = double; Eigen::TensorMap<PlainObjectType, Options_>::Index = long int]’:
DeepLearningModel.cpp:120:15: required from here
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h:227:7: error: static assertion failed: Number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
static_assert(sizeof...(otherIndices) + 1 == NumIndices || NumIndices == Dynamic, "Number of indices used to access a tensor coefficient must be equal to the rank of the tensor.");
^
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h:230:110: error: no matching function for call to ‘Eigen::DSizes<long int, 1>::IndexOfRowMajor(Eigen::array<long int, 2ul>)’
const Index index = m_dimensions.IndexOfRowMajor(array<Index, NumDims>{{firstIndex, otherIndices...}});
^
In file included from ./include/eigen3/unsupported/Eigen/CXX11/Tensor:68:0,
from ./include/tf/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
from ./include/tf/tensorflow/core/framework/tensor.h:19,
from ./include/tf/tensorflow/core/public/session.h:24,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:336:52: note: candidate: DenseIndex Eigen::DSizes<DenseIndex, NumDims>::IndexOfRowMajor(Eigen::array<DenseIndex, NumDims>&) const [with DenseIndex = long int; int NumDims = 1; Eigen::array<DenseIndex, NumDims> = std::array<long int, 1ul>]
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfRowMajor(const array<DenseIndex, NumDims>& indices) const {
^
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:336:52: note: no known conversion for argument 1 from ‘Eigen::array<long int, 2ul> {aka std::array<long int, 2ul>}’ to ‘Eigen::array<long int, 1ul>& {aka const std::array<long int, 1ul>&}’
In file included from ./include/eigen3/unsupported/Eigen/CXX11/Tensor:113:0,
from ./include/tf/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
from ./include/tf/tensorflow/core/framework/tensor.h:19,
from ./include/tf/tensorflow/core/public/session.h:24,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h:233:110: error: no matching function for call to ‘Eigen::DSizes<long int, 1>::IndexOfColMajor(Eigen::array<long int, 2ul>)’
const Index index = m_dimensions.IndexOfColMajor(array<Index, NumDims>{{firstIndex, otherIndices...}});
^
In file included from ./include/eigen3/unsupported/Eigen/CXX11/Tensor:68:0,
from ./include/tf/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
from ./include/tf/tensorflow/core/framework/tensor.h:19,
from ./include/tf/tensorflow/core/public/session.h:24,
from DeepLearningModel.h:5,
from DeepLearningModel.cpp:1:
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:333:52: note: candidate: DenseIndex Eigen::DSizes<DenseIndex, NumDims>::IndexOfColMajor(Eigen::array<DenseIndex, NumDims>&) const [with DenseIndex = long int; int NumDims = 1; Eigen::array<DenseIndex, NumDims> = std::array<long int, 1ul>]
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfColMajor(const array<DenseIndex, NumDims>& indices) const {
^
./include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:333:52: note: no known conversion for argument 1 from ‘Eigen::array<long int, 2ul> {aka std::array<long int, 2ul>}’ to ‘Eigen::array<long int, 1ul>& {aka const std::array<long int, 1ul>&}’
What's wrong with Eigen and how can I fix it?
Help please...

why I can't use qt to program in linux normally

I am new to QT,so I want to write a "Hello World" to learn QT first.
1.First,I install the QT5 on my computer.(Archlinux).
sudo pacman -S qt5-base qt5
Then,I install qt-creator.
sudo pacman -S qtcreator
And,I use QT creator to create a new project(I select Qt widgets Application).
the IDE generate some code automatically.I don't add any code to the source file.
.pro:
#-------------------------------------------------
#
# Project created by QtCreator 2017-05-21T14:48:56
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact
warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated
APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain
version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all
the APIs deprecated before Qt 6.0.0
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
I think it should generate a blank window when I build and run.
However,When I try to build and run.There are so many issues.
The Picture
I don't know why this happen.
Then I try to use the official examples.I follow the official tutorial Building and Running an Example.Howerver,same issues occurs when I try to build and run.
2.Wyzard say that I should use std=c++11 to compile the program.
So,I create a main.cpp file.
main.cpp:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
Then,I use qmake to generate a makefile.
$qmake -project
$qmake
And,I add -std=c++11 to the compile flags.
make
output:
g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -std=c++11 -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/qt/mkspecs/linux-g++ -I/usr/include/qt/QtWidgets/ -o hello.o hello.cpp
In file included from /usr/include/qt/QtCore/qbasicatomic.h:53:0,
from /usr/include/qt/QtCore/qatomic.h:46,
from /usr/include/qt/QtCore/qglobal.h:1129,
from /usr/include/qt/QtGui/qtguiglobal.h:43,
from /usr/include/qt/QtWidgets/qtwidgetsglobal.h:43,
from /usr/include/qt/QtWidgets/qapplication.h:43,
from /usr/include/qt/QtWidgets/QApplication:1,
from hello.cpp:1:
/usr/include/qt/QtCore/qatomic_cxx11.h:222:18: error: ‘atomic’ in namespace ‘std’ does not name a template type
typedef std::atomic<X> Type;
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:225:23: error: ‘atomic’ in namespace ‘std’ does not name a template type
T load(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:225:29: error: expected ‘,’ or ‘...’ before ‘<’ token
T load(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:231:32: error: ‘atomic’ in namespace ‘std’ does not name a template type
T load(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:231:38: error: expected ‘,’ or ‘...’ before ‘<’ token
T load(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:231:7: error: ‘template<class X> template<class T> static T QAtomicOps<X>::load(int)’ cannot be overloaded
T load(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:225:7: error: with ‘template<class X> template<class T> static T QAtomicOps<X>::load(int)’
T load(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:237:30: error: ‘atomic’ in namespace ‘std’ does not name a template type
T loadAcquire(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:237:36: error: expected ‘,’ or ‘...’ before ‘<’ token
T loadAcquire(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:243:39: error: ‘atomic’ in namespace ‘std’ does not name a template type
T loadAcquire(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:243:45: error: expected ‘,’ or ‘...’ before ‘<’ token
T loadAcquire(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:243:7: error: ‘template<class X> template<class T> static T QAtomicOps<X>::loadAcquire(int)’ cannot be overloaded
T loadAcquire(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:237:7: error: with ‘template<class X> template<class T> static T QAtomicOps<X>::loadAcquire(int)’
T loadAcquire(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:249:21: error: ‘std::atomic’ has not been declared
void store(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:249:27: error: expected ‘,’ or ‘...’ before ‘<’ token
void store(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:255:28: error: ‘std::atomic’ has not been declared
void storeRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:255:34: error: expected ‘,’ or ‘...’ before ‘<’ token
void storeRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:263:33: error: ‘std::atomic’ has not been declared
static inline bool ref(std::atomic<T> &_q_value)
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:263:39: error: expected ‘,’ or ‘...’ before ‘<’ token
static inline bool ref(std::atomic<T> &_q_value)
^
/usr/include/qt/QtCore/qatomic_cxx11.h:269:35: error: ‘std::atomic’ has not been declared
static inline bool deref(std::atomic<T> &_q_value) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:269:41: error: expected ‘,’ or ‘...’ before ‘<’ token
static inline bool deref(std::atomic<T> &_q_value) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:279:40: error: ‘std::atomic’ has not been declared
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:279:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^
In file included from /usr/include/qt/QtCore/qbasicatomic.h:53:0,
from /usr/include/qt/QtCore/qatomic.h:46,
from /usr/include/qt/QtCore/qglobal.h:1129,
from /usr/include/qt/QtGui/qtguiglobal.h:43,
from /usr/include/qt/QtWidgets/qtwidgetsglobal.h:43,
from /usr/include/qt/QtWidgets/qapplication.h:43,
from /usr/include/qt/QtWidgets/QApplication:1,
from hello.cpp:1:
/usr/include/qt/QtCore/qatomic_cxx11.h:288:40: error: ‘std::atomic’ has not been declared
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:288:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:297:40: error: ‘std::atomic’ has not been declared
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:297:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:306:40: error: ‘std::atomic’ has not been declared
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:306:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:318:40: error: ‘std::atomic’ has not been declared
static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:318:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:324:40: error: ‘std::atomic’ has not been declared
static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:324:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:330:40: error: ‘std::atomic’ has not been declared
static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:330:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:336:40: error: ‘std::atomic’ has not been declared
static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:336:46: error: expected ‘,’ or ‘...’ before ‘<’ token
static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:345:31: error: ‘std::atomic’ has not been declared
T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:345:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:351:31: error: ‘std::atomic’ has not been declared
T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:351:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:357:31: error: ‘std::atomic’ has not been declared
T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:357:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:363:31: error: ‘std::atomic’ has not been declared
T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:363:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:369:31: error: ‘std::atomic’ has not been declared
T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:369:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:375:31: error: ‘std::atomic’ has not been declared
T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:375:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:381:31: error: ‘std::atomic’ has not been declared
T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:381:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:387:31: error: ‘std::atomic’ has not been declared
T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:387:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:393:31: error: ‘std::atomic’ has not been declared
T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:393:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:399:31: error: ‘std::atomic’ has not been declared
T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:399:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:405:31: error: ‘std::atomic’ has not been declared
T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:405:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:411:31: error: ‘std::atomic’ has not been declared
T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:411:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:417:30: error: ‘std::atomic’ has not been declared
T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:417:36: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:423:30: error: ‘std::atomic’ has not been declared
T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:423:36: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:429:30: error: ‘std::atomic’ has not been declared
T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:429:36: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:435:30: error: ‘std::atomic’ has not been declared
T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:435:36: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:441:31: error: ‘std::atomic’ has not been declared
T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:441:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:447:31: error: ‘std::atomic’ has not been declared
T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:447:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:453:31: error: ‘std::atomic’ has not been declared
T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:453:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
/usr/include/qt/QtCore/qatomic_cxx11.h:459:31: error: ‘std::atomic’ has not been declared
T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:459:37: error: expected ‘,’ or ‘...’ before ‘<’ token
T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
^
In file included from /usr/include/qt/QtCore/qbasicatomic.h:53:0,
from /usr/include/qt/QtCore/qatomic.h:46,
from /usr/include/qt/QtCore/qglobal.h:1129,
from /usr/include/qt/QtGui/qtguiglobal.h:43,
from /usr/include/qt/QtWidgets/qtwidgetsglobal.h:43,
from /usr/include/qt/QtWidgets/qapplication.h:43,
from /usr/include/qt/QtWidgets/QApplication:1,
from hello.cpp:1:
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static T QAtomicOps<X>::load(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:227:16: error: ‘_q_value’ was not declared in this scope
return _q_value.load(std::memory_order_relaxed);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:227:30: error: ‘memory_order_relaxed’ is not a member of ‘std’
return _q_value.load(std::memory_order_relaxed);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static T QAtomicOps<X>::load(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:233:16: error: ‘_q_value’ was not declared in this scope
return _q_value.load(std::memory_order_relaxed);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:233:30: error: ‘memory_order_relaxed’ is not a member of ‘std’
return _q_value.load(std::memory_order_relaxed);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static T QAtomicOps<X>::loadAcquire(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:239:16: error: ‘_q_value’ was not declared in this scope
return _q_value.load(std::memory_order_acquire);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:239:30: error: ‘memory_order_acquire’ is not a member of ‘std’
return _q_value.load(std::memory_order_acquire);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static T QAtomicOps<X>::loadAcquire(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:245:16: error: ‘_q_value’ was not declared in this scope
return _q_value.load(std::memory_order_acquire);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:245:30: error: ‘memory_order_acquire’ is not a member of ‘std’
return _q_value.load(std::memory_order_acquire);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static void QAtomicOps<X>::store(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:251:9: error: ‘_q_value’ was not declared in this scope
_q_value.store(newValue, std::memory_order_relaxed);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:251:24: error: ‘newValue’ was not declared in this scope
_q_value.store(newValue, std::memory_order_relaxed);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:251:34: error: ‘memory_order_relaxed’ is not a member of ‘std’
_q_value.store(newValue, std::memory_order_relaxed);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static void QAtomicOps<X>::storeRelease(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:257:9: error: ‘_q_value’ was not declared in this scope
_q_value.store(newValue, std::memory_order_release);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:257:24: error: ‘newValue’ was not declared in this scope
_q_value.store(newValue, std::memory_order_release);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:257:34: error: ‘memory_order_release’ is not a member of ‘std’
_q_value.store(newValue, std::memory_order_release);
^~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static bool QAtomicOps<X>::ref(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:265:18: error: ‘_q_value’ was not declared in this scope
return ++_q_value != 0;
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static bool QAtomicOps<X>::deref(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:271:18: error: ‘_q_value’ was not declared in this scope
return --_q_value != 0;
^~~~~~~~
In file included from /usr/include/qt/QtCore/qbasicatomic.h:53:0,
from /usr/include/qt/QtCore/qatomic.h:46,
from /usr/include/qt/QtCore/qglobal.h:1129,
from /usr/include/qt/QtGui/qtguiglobal.h:43,
from /usr/include/qt/QtWidgets/qtwidgetsglobal.h:43,
from /usr/include/qt/QtWidgets/qapplication.h:43,
from /usr/include/qt/QtWidgets/QApplication:1,
from hello.cpp:1:
/usr/include/qt/QtCore/qatomic_cxx11.h: In static member function ‘static bool QAtomicOps<X>::testAndSetRelaxed(int)’:
/usr/include/qt/QtCore/qatomic_cxx11.h:281:20: error: ‘_q_value’ was not declared in this scope
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed);
^~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:281:53: error: ‘expectedValue’ was not declared in this scope
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed);
^~~~~~~~~~~~~
/usr/include/qt/QtCore/qatomic_cxx11.h:281:68: error: ‘newValue’ was not declared in this scope
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed);
^~~~~~~~
.......
English is not my native language; please excuse typing errors.
Your screenshot shows that the errors are in a file called qatomic_cxx11.h, and they relate to features that were added to the language in C++11. It's likely that your compiler is treating the code as C++98, where things like std::atomic don't exist.
You probably need to add -std=c++11 as a compile option, to tell it to compile as C++11. (Or, if your compiler supports it, use std=c++14 to compile as C++14.)

OpenCV symbol was not declared in this scope

I'm trying to compile a source-code from another person. Its OpenCV in C++.
I created a new Ubuntu Virtual Machine 64bit and installed this packets:
sudo apt-get install -y subversion build-essential git cmake libopencv-legacy-dev
git clone https://github.com/Itseez/opencv.git
cd ~/opencv_tmp/opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
sudo make install
Then I tried compile
cd project
mkdir build
cd build
cmake ..
make
And then this returned this error:
12%] Building CXX object CMakeFiles/Project.dir/main.o
In file included from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp:1750:53: error: ‘cv::EM’ has not been declared
CvEMParams( int nclusters, int cov_mat_type=cv::EM::COV_MAT_DIAGONAL,
^
/usr/include/opencv2/legacy/legacy.hpp:1751:36: error: ‘cv::EM’ has not been declared
int start_step=cv::EM::START_AUTO_STEP,
^
/usr/include/opencv2/legacy/legacy.hpp:1767:1: error: expected class-name before ‘{’ token
{
^
(...)
^
^
^
/usr/include/opencv2/legacy/legacy.hpp:2600:73: error: expected ‘,’ or ‘...’ before ‘<’ token
void InitializeObjectDescriptors(IplImage* train_image, const vector<KeyPoint>& features,
^
/usr/include/opencv2/legacy/legacy.hpp:2609:5: error: ‘vector’ does not name a type
vector<KeyPoint> m_train_features; // train features
^
/usr/include/opencv2/legacy/legacy.hpp:2572:63: error: ‘string’ was not declared in this scope
const string &train_path = string (), const string &images_list = string (),
^
/usr/include/opencv2/legacy/legacy.hpp:2572:63: note: suggested alternative:
In file included from /usr/include/c++/4.8/string:39:0,
from /usr/local/include/opencv2/core/cvstd.hpp:58,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xx,
from xx:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp:2572:102: error: ‘string’ was not declared in this scope
const string &train_path = string (), const string &images_list = string (),
^
/usr/include/opencv2/legacy/legacy.hpp:2572:102: note: suggested alternative:
In file included from /usr/include/c++/4.8/string:39:0,
from /usr/local/include/opencv2/core/cvstd.hpp:58,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xx,
from xx:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp: In member function ‘void cv::OneWayDescriptorObject::SetLabeledFeatures(int)’:
/usr/include/opencv2/legacy/legacy.hpp:2584:64: error: ‘m_train_features’ was not declared in this scope
void SetLabeledFeatures(const vector<KeyPoint>& features) {m_train_features = features;};
^
/usr/include/opencv2/legacy/legacy.hpp:2584:83: error: ‘features’ was not declared in this scope
void SetLabeledFeatures(const vector<KeyPoint>& features) {m_train_features = features;};
^
/usr/include/opencv2/legacy/legacy.hpp: At global scope:
/usr/include/opencv2/legacy/legacy.hpp:2622:1: error: expected class-name before ‘{’ token
{
^
/usr/include/opencv2/legacy/legacy.hpp:2636:16: error: ‘string’ has not been declared
string pcaFilename = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2637:16: error: ‘string’ has not been declared
string trainPath = string(), string trainImagesList = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2637:45: error: ‘string’ has not been declared
string trainPath = string(), string trainImagesList = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2643:9: error: ‘string’ does not name a type
string pcaFilename;
^
/usr/include/opencv2/legacy/legacy.hpp:2644:9: error: ‘string’ does not name a type
string trainPath;
^
/usr/include/opencv2/legacy/legacy.hpp:2645:9: error: ‘string’ does not name a type
string trainImagesList;
^
/usr/include/opencv2/legacy/legacy.hpp:2667:17: error: ‘GenericDescriptorMatcher’ was not declared in this scope
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2667:41: error: template argument 1 is invalid
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2676:55: error: ‘vector’ has not been declared
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2676:61: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2679:58: error: ‘vector’ has not been declared
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2679:64: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2636:44: error: ‘string’ was not declared in this scope
string pcaFilename = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2636:44: note: suggested alternative:
In file included from /usr/include/c++/4.8/string:39:0,
from /usr/local/include/opencv2/core/cvstd.hpp:58,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xx,
from xx:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp:2637:42: error: ‘string’ was not declared in this scope
string trainPath = string(), string trainImagesList = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2637:42: note: suggested alternative:
In file included from /usr/include/c++/4.8/string:39:0,
from /usr/local/include/opencv2/core/cvstd.hpp:58,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xx,
from xx:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp:2637:77: error: ‘string’ was not declared in this scope
string trainPath = string(), string trainImagesList = string(),
^
/usr/include/opencv2/legacy/legacy.hpp:2637:77: note: suggested alternative:
In file included from /usr/include/c++/4.8/string:39:0,
from /usr/local/include/opencv2/core/cvstd.hpp:58,
from /usr/local/include/opencv2/core/base.hpp:55,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xxxx,
from xxxx:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from xxx,
from xxxx:
/usr/include/opencv2/legacy/legacy.hpp:2650:58: error: call to ‘cv::OneWayDescriptorMatcher::Params::Params(int, cv::Size, int, int, int, float, float, float)’ uses the default argument for parameter 3, which is not yet defined
OneWayDescriptorMatcher( const Params& params=Params() );
^
/usr/include/opencv2/legacy/legacy.hpp:2650:58: error: call to ‘cv::OneWayDescriptorMatcher::Params::Params(int, cv::Size, int, int, int, float, float, float)’ uses the default argument for parameter 4, which is not yet defined
/usr/include/opencv2/legacy/legacy.hpp:2650:58: error: call to ‘cv::OneWayDescriptorMatcher::Params::Params(int, cv::Size, int, int, int, float, float, float)’ uses the default argument for parameter 5, which is not yet defined
/usr/include/opencv2/legacy/legacy.hpp:2695:1: error: expected class-name before ‘{’ token
{
^
/usr/include/opencv2/legacy/legacy.hpp:2709:23: error: ‘string’ does not name a type
Params( const string& filename );
^
/usr/include/opencv2/legacy/legacy.hpp:2720:9: error: ‘string’ does not name a type
string filename;
^
/usr/include/opencv2/legacy/legacy.hpp:2736:17: error: ‘GenericDescriptorMatcher’ was not declared in this scope
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2736:41: error: template argument 1 is invalid
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2739:55: error: ‘vector’ has not been declared
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2739:61: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2742:58: error: ‘vector’ has not been declared
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2742:64: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2748:70: error: ‘vector’ has not been declared
float& bestProb, int& bestMatchIdx, vector<float>& signature );
^
/usr/include/opencv2/legacy/legacy.hpp:2748:76: error: expected ‘,’ or ‘...’ before ‘<’ token
float& bestProb, int& bestMatchIdx, vector<float>& signature );
^
/usr/include/opencv2/legacy/legacy.hpp:2762:40: error: ‘string’ does not name a type
CalonderDescriptorExtractor( const string& classifierFile );
^
/usr/include/opencv2/legacy/legacy.hpp:2773:49: error: ‘vector’ has not been declared
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2773:55: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2780:1: error: prototype for ‘cv::CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const string&)’ does not match any in class ‘cv::CalonderDescriptorExtractor<T>’
CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const std::string& classifier_file)
^
/usr/include/opencv2/legacy/legacy.hpp:2762:5: error: candidate is: cv::CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const int&)
CalonderDescriptorExtractor( const string& classifierFile );
^
/usr/include/opencv2/legacy/legacy.hpp:2787:50: error: ‘vector’ has not been declared
vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2787:56: error: expected ‘,’ or ‘...’ before ‘<’ token
vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp: In member function ‘virtual void cv::CalonderDescriptorExtractor<T>::computeImpl(const cv::Mat&, int) const’:
/usr/include/opencv2/legacy/legacy.hpp:2791:39: error: ‘keypoints’ was not declared in this scope
KeyPointsFilter::runByImageBorder(keypoints, image.size(), BORDER_SIZE);
^
/usr/include/opencv2/legacy/legacy.hpp:2794:5: error: ‘descriptors’ was not declared in this scope
descriptors.create((int)keypoints.size(), classifier_.classes(), cv::DataType<T>::type);
^
/usr/include/opencv2/legacy/legacy.hpp:2802:58: error: expected primary-expression before ‘>’ token
classifier_.getSignature( &ipl, descriptors.ptr<T>((int)i));
^
/usr/include/opencv2/legacy/legacy.hpp: In member function ‘virtual bool cv::CalonderDescriptorExtractor<T>::empty() const’:
/usr/include/opencv2/legacy/legacy.hpp:2817:24: error: ‘const class cv::RTreeClassifier’ has no member named ‘trees_’
return classifier_.trees_.empty();
^
/usr/include/opencv2/legacy/legacy.hpp: At global scope:
/usr/include/opencv2/legacy/legacy.hpp:2841:32: error: ‘vector’ does not name a type
PlanarObjectDetector(const vector<Mat>& pyr, int _npoints=300,
^
/usr/include/opencv2/legacy/legacy.hpp:2841:38: error: expected ‘,’ or ‘...’ before ‘<’ token
PlanarObjectDetector(const vector<Mat>& pyr, int _npoints=300,
^
/usr/include/opencv2/legacy/legacy.hpp:2849:30: error: ‘vector’ does not name a type
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/include/opencv2/legacy/legacy.hpp:2849:36: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/include/opencv2/legacy/legacy.hpp:2856:30: error: ‘vector’ does not name a type
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2856:36: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2856:18: error: ‘virtual void cv::PlanarObjectDetector::train(int)’ cannot be overloaded
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2849:18: error: with ‘virtual void cv::PlanarObjectDetector::train(int)’
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/include/opencv2/legacy/legacy.hpp:2864:5: error: ‘vector’ does not name a type
vector<KeyPoint> getModelPoints() const;
^
/usr/include/opencv2/legacy/legacy.hpp:2871:61: error: ‘vector’ has not been declared
bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT vector<Point2f>& corners) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2871:67: error: expected ‘,’ or ‘...’ before ‘<’ token
bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT vector<Point2f>& corners) const;
^
/usr/include/opencv2/legacy/legacy.hpp:2872:27: error: ‘vector’ does not name a type
bool operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2872:33: error: expected ‘,’ or ‘...’ before ‘<’ token
bool operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/include/opencv2/legacy/legacy.hpp:2879:5: error: ‘vector’ does not name a type
vector<KeyPoint> modelPoints;
^
/usr/include/opencv2/legacy/legacy.hpp:2927:38: error: variable or field ‘cvInitSubdivDelaunay2D’ declared void
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
^
/usr/include/opencv2/legacy/legacy.hpp:2927:38: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/include/opencv2/legacy/legacy.hpp:2927:50: error: ‘subdiv’ was not declared in this scope
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
^
/usr/include/opencv2/legacy/legacy.hpp:2927:65: error: expected primary-expression before ‘rect’
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
^
In file included from /usr/local/include/opencv2/core/core_c.h:48:0,
from /usr/local/include/opencv2/core/utility.hpp:765,
from /usr/local/include/opencv2/core.hpp:2960,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from /home/xxxxxxxx,
from /homxxxxxxxxxxxxrc/main.cpp:2:
/usr/include/opencv2/legacy/legacy.hpp:2930:1: error: ‘CvSubdiv2D’ does not name a type
CVAPI(CvSubdiv2D*) cvCreateSubdiv2D( int subdiv_type, int header_size,
^
In file included from xx,
from xxxx:
/usr/include/opencv2/legacy/legacy.hpp:2937:12: error: ‘CvSubdiv2D’ does not name a type
CV_INLINE CvSubdiv2D* cvCreateSubdivDelaunay2D( CvRect rect, CvMemStorage* storage )
^
In file included from /usr/local/include/opencv2/core/core_c.h:48:0,
from /usr/local/include/opencv2/core/utility.hpp:765,
from /usr/local/include/opencv2/core.hpp:2960,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xx,
from xx:
/usr/include/opencv2/legacy/legacy.hpp:2948:1: error: ‘CvSubdiv2DPoint’ does not name a type
CVAPI(CvSubdiv2DPoint*) cvSubdivDelaunay2DInsert( CvSubdiv2D* subdiv, CvPoint2D32f pt);
^
/usr/include/opencv2/legacy/legacy.hpp:2953:1: error: ‘CvSubdiv2DPointLocation’ does not name a type
CVAPI(CvSubdiv2DPointLocation) cvSubdiv2DLocate(
^
In file included from xxxxxx,
from xxxxxxx:
/usr/include/opencv2/legacy/legacy.hpp:2959:37: error: variable or field ‘cvCalcSubdivVoronoi2D’ declared void
CVAPI(void) cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/include/opencv2/legacy/legacy.hpp:2959:37: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/include/opencv2/legacy/legacy.hpp:2959:49: error: ‘subdiv’ was not declared in this scope
CVAPI(void) cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/include/opencv2/legacy/legacy.hpp:2963:38: error: variable or field ‘cvClearSubdivVoronoi2D’ declared void
CVAPI(void) cvClearSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/include/opencv2/legacy/legacy.hpp:2963:38: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/include/opencv2/legacy/legacy.hpp:2963:50: error: ‘subdiv’ was not declared in this scope
CVAPI(void) cvClearSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
In file included from /usr/local/include/opencv2/core/core_c.h:48:0,
from /usr/local/include/opencv2/core/utility.hpp:765,
from /usr/local/include/opencv2/core.hpp:2960,
from /usr/local/include/opencv2/highgui.hpp:46,
from /usr/local/include/opencv2/highgui/highgui.hpp:48,
from xxxxxxxxxxx,
from xxxxxxxxxxx:
/usr/include/opencv2/legacy/legacy.hpp:2967:1: error: ‘CvSubdiv2DPoint’ does not name a type
CVAPI(CvSubdiv2DPoint*) cvFindNearestPoint2D( CvSubdiv2D* subdiv, CvPoint2D32f pt );
^
In file included from xxxxxxxxxxxxxxx
/usr/include/opencv2/legacy/legacy.hpp:2972:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DNextEdge( CvSubdiv2DEdge edge )
^
/usr/include/opencv2/legacy/legacy.hpp:2978:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DRotateEdge( CvSubdiv2DEdge edge, int rotate )
^
/usr/include/opencv2/legacy/legacy.hpp:2983:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DSymEdge( CvSubdiv2DEdge edge )
^
/usr/include/opencv2/legacy/legacy.hpp:2988:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DGetEdge( CvSubdiv2DEdge edge, CvNextEdgeType type )
^
/usr/include/opencv2/legacy/legacy.hpp:2996:12: error: ‘CvSubdiv2DPoint’ does not name a type
CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge )
^
/usr/include/opencv2/legacy/legacy.hpp:3003:12: error: ‘CvSubdiv2DPoint’ does not name a type
CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )
^
/usr/include/opencv2/legacy/legacy.hpp:3014:29: error: variable or field ‘icvDrawMosaic’ declared void
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3014:29: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/include/opencv2/legacy/legacy.hpp:3014:41: error: ‘subdiv’ was not declared in this scope
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3014:57: error: expected primary-expression before ‘*’ token
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3014:59: error: ‘src’ was not declared in this scope
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3014:72: error: expected primary-expression before ‘*’ token
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3014:74: error: ‘dst’ was not declared in this scope
CVAPI(void) icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );
^
/usr/include/opencv2/legacy/legacy.hpp:3018:32: error: ‘CvSubdiv2D’ was not declared in this scope
CVAPI(int) icvSubdiv2DCheck( CvSubdiv2D* subdiv );
^
/usr/include/opencv2/legacy/legacy.hpp:3018:44: error: ‘subdiv’ was not declared in this scope
CVAPI(int) icvSubdiv2DCheck( CvSubdiv2D* subdiv );
^
make[2]: *** [CMakeFiles/Project.dir/main.o] Error 1
make[1]: *** [CMakeFiles/Project.dir/all] Error 2
make: *** [all] Error 2
If you can switch to OpenCv v 3.3.0, the EM class is simply namespaced as cv::ml::EM.

Suspected std::array C++11 library is broken? What do I do?

From google I can't seem to find clear answers, But I don't know what to do. I suspected there might be a problem in a larger program I was writing with the array C++11 library for g++ and wrote a test program. I am using g++ 4.8.1.
main.cpp:
#include <iostream>
#include <array>
int main()
{
std::array<int,5> vector;
return 0;
}
My test command line compile is:
g++ main.cpp -std=c++11
with errors..
In file included from main.cpp:2:0:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:107:12: error: 'array' has not been declared
swap(array& __other)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array: In member function 'void std::Array<_Tp, _Nm>::swap(int&)':
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:109:50: error: request for member 'begin' in '__other', which is of non-class type 'int'
{ std::swap_ranges(begin(), end(), __other.begin()); }
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array: At global scope:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:228:22: error: 'array' does not name a type
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:228:27: error: expected ',' or '...' before '<' token
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:228:74: error: 'bool std::operator==(int)' must have an argument of class or enumerated type
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:233:22: error: 'array' does not name a type
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:233:27: error: expected ',' or '...' before '<' token
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:233:74: error: 'bool std::operator!=(int)' must have an argument of class or enumerated type
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:238:21: error: 'array' does not name a type
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:238:26: error: expected ',' or '...' before '<' token
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:238:69: error: 'bool std::operator<(int)' must have an argument of class or enumerated type
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:246:21: error: 'array' does not name a type
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:246:26: error: expected ',' or '...' before '<' token
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:246:73: error: 'bool std::operator>(int)' must have an argument of class or enumerated type
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:251:22: error: 'array' does not name a type
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:251:27: error: expected ',' or '...' before '<' token
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:251:74: error: 'bool std::operator<=(int)' must have an argument of class or enumerated type
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:256:22: error: 'array' does not name a type
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:256:27: error: expected ',' or '...' before '<' token
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:256:74: error: 'bool std::operator>=(int)' must have an argument of class or enumerated type
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:10: error: variable or field 'swap' declared void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:10: error: 'array' was not declared in this scope
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:19: error: expected primary-expression before ',' token
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:27: error: '__one' was not declared in this scope
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:34: error: 'array' was not declared in this scope
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:43: error: expected primary-expression before ',' token
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:262:51: error: '__two' was not declared in this scope
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:268:9: error: template declaration of 'constexpr _Tp& std::get'
get(array<_Tp, _Nm>& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:268:9: error: 'array' was not declared in this scope
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:268:18: error: expected primary-expression before ',' token
get(array<_Tp, _Nm>& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:268:26: error: '__arr' was not declared in this scope
get(array<_Tp, _Nm>& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:277:9: error: template declaration of 'constexpr _Tp&& std::get'
get(array<_Tp, _Nm>&& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:277:9: error: 'array' was not declared in this scope
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:277:18: error: expected primary-expression before ',' token
get(array<_Tp, _Nm>&& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:277:27: error: label '__arr' referenced outside of any function
get(array<_Tp, _Nm>&& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:277:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:285:15: error: 'array' does not name a type
get(const array<_Tp, _Nm>& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:285:20: error: expected ',' or '...' before '<' token
get(const array<_Tp, _Nm>& __arr) noexcept
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array: In function 'constexpr const _Tp& std::get(int)':
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:289:9: error: '__arr' was not declared in this scope
_S_ref(__arr._M_elems, _Int);
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:38:0,
from main.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array: At global scope:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:306:23: error: 'array' is not a member of 'std'
struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>>
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:306:23: error: 'array' is not a member of 'std'
In file included from main.cpp:2:0:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:306:50: error: wrong number of template arguments (2, should be 1)
struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>>
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:303:11: error: provided for 'template<class _Tp> class std::tuple_size'
class tuple_size;
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:306:53: error: expected unqualified-id before '>' token
struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>>
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:38:0,
from main.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:314:32: error: 'array' is not a member of 'std'
struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>>
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:314:32: error: 'array' is not a member of 'std'
In file included from main.cpp:2:0:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:314:59: error: wrong number of template arguments (3, should be 2)
struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>>
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:311:11: error: provided for 'template<unsigned int _Int, class _Tp> class std::tuple_element'
class tuple_element;
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\array:314:62: error: expected unqualified-id before '>' token
struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>>
^
main.cpp: In function 'int main()':
main.cpp:5:2: error: 'array' is not a member of 'std'
std::array<int,5> vector;
^
main.cpp:5:13: error: expected primary-expression before 'int'
std::array<int,5> vector;
^
main.cpp:5:13: error: expected ';' before 'int'
And clearly from the error, there is a lot of reference to the std::array file that i have included which seems to be the source of the error. What do I do?
Thanks in advance.
EDIT: added compilation commands and g++ version.
Turns out somehow a typo made its way into OP's <array>. What should have been
template<typename _Tp, std::size_t _Nm>
struct array
{
became
template<typename _Tp, std::size_t _Nm>
struct Array
{
Causing a bazillion compiler errors as it tries to process the rest of <array>.
This is a valid C++11 program.
The error you got is most probably due to dialect selection: the C++98 mode does not provide std::array container. See the docs at http://en.cppreference.com/w/cpp/container/array
Specifically, your error comes down to the following:
main.cpp: In function 'int main()':
main.cpp:5:2: error: 'array' is not a member of 'std'
std::array<int,5> vector;
^
main.cpp:5:13: error: expected primary-expression before 'int'
std::array<int,5> vector;
^
main.cpp:5:13: error: expected ';' before 'int'
So, just add -std=c++11 to the command line and things should work.
unable to reproduce with g++ 4.8.1 at Ideone:
the error messages are consistent with not providing option -std=c++11
add that option to the command line