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

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

Related

C++ compilation problem showing problem with header files on macos

tried to run a cpp file and i get the same error no matter which file I run . How to fix this ?
This is the same even if I use g++ (homebrew) .
I thought about deleting usr/include/c++/v1 and then try to re-install it . But not confident if that would be a good idea ,
$ clang++ contrc.cpp
In file included from contrc.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:37:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:214:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:95:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:137:77: error: use of undeclared identifier 'wcschr'
wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:144:87: error: use of undeclared identifier 'wcspbrk'
wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:151:78: error: use of undeclared identifier 'wcsrchr'; did you mean 'wcschr'?
wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:139:16: note: 'wcschr' declared here
const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:158:86: error: use of undeclared identifier 'wcsstr'; did you mean 'wcschr'?
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:141:16: note: 'wcschr' declared here
wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:158:86: error: no matching function for call to 'wcschr'
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:141:16: note: candidate disabled: <no message provided>
wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:158:93: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'const wchar_t *'
wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:141:38: note: passing argument to parameter '__s' here
wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:165:60: error: unknown type name 'size_t'
wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:167:57: error: unknown type name 'size_t'
const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:169:57: error: unknown type name 'size_t'
wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
^
In file included from contrc.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:37:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:214:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:189:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t> streampos;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:190:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t> wstreampos;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:192:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t> u8streampos;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:195:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t> u16streampos;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:196:14: error: use of undeclared identifier 'mbstate_t'
typedef fpos<mbstate_t> u32streampos;
^
In file included from contrc.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:37:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:215:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:506:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:175:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:639:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/initializer_list:46:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstddef:49:9: error: no member named 'ptrdiff_t' in the global namespace
using ::ptrdiff_t;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstddef:50:9: error: no member named 'size_t' in the global namespace
using ::size_t;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstddef:53:9: error: no member named 'max_align_t' in the global namespace
using ::max_align_t;
~~^
In file included from contrc.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:37:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:215:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:506:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:175:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:639:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/initializer_list:61:5: error: unknown type name 'size_t'
size_t __size_;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/initializer_list:65:38: error: unknown type name 'size_t'
initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

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.

Unable to Build OpenCV project in eclipse CDT 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)

Tensorflow Serving bazel build Error: mnist_inference_2.cc - Signatures' has not been declared

I am trying to replicate tensorflow serving examples from https://tensorflow.github.io/serving/serving_advanced.html
But I get following error. It is possibly Tensorflow library error. Any help will be greatly appreciated.
:
~/serving$ bazel build //tensorflow_serving/example:mnist_inference_2
INFO: Found 1 target...
ERROR: /home/ubuntu/serving/tensorflow_serving/session_bundle/BUILD:125:1: C++ compilation of rule '//tensorflow_serving/session_bundle:session_bundle' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . ... (remaining 103 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from ./tensorflow_serving/session_bundle/session_bundle.h:30:0,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
./tensorflow_serving/session_bundle/signature.h:40:22: error: 'Signatures' has not been declared
Signatures* signatures);
^
./tensorflow_serving/session_bundle/signature.h:43:28: error: 'Signatures' does not name a type
Status SetSignatures(const Signatures& signatures,
^
./tensorflow_serving/session_bundle/signature.h:43:40: error: ISO C++ forbids declaration of 'signatures' with no type [-fpermissive]
Status SetSignatures(const Signatures& signatures,
^
./tensorflow_serving/session_bundle/signature.h:51:5: error: 'ClassificationSignature' has not been declared
ClassificationSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:58:5: error: 'ClassificationSignature' has not been declared
ClassificationSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:64:31: error: 'RegressionSignature' has not been declared
RegressionSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:73:32: error: 'ClassificationSignature' does not name a type
Status RunClassification(const ClassificationSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:73:57: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status RunClassification(const ClassificationSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:83:28: error: 'RegressionSignature' does not name a type
Status RunRegression(const RegressionSignature& signature, const Tensor& input,
^
./tensorflow_serving/session_bundle/signature.h:83:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status RunRegression(const RegressionSignature& signature, const Tensor& input,
^
./tensorflow_serving/session_bundle/signature.h:90:28: error: 'GenericSignature' has not been declared
GenericSignature* signature);
^
./tensorflow_serving/session_bundle/signature.h:94:28: error: 'Signature' has not been declared
Signature* default_signature);
^
./tensorflow_serving/session_bundle/signature.h:100:26: error: 'Signature' has not been declared
Signature* default_signature);
^
./tensorflow_serving/session_bundle/signature.h:106:32: error: 'GenericSignature' does not name a type
Status BindGenericInputs(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:106:50: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status BindGenericInputs(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:117:31: error: 'GenericSignature' does not name a type
Status BindGenericNames(const GenericSignature& signature,
^
./tensorflow_serving/session_bundle/signature.h:117:49: error: ISO C++ forbids declaration of 'signature' with no type [-fpermissive]
Status BindGenericNames(const GenericSignature& signature,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:49: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:68:58: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc: In function 'void tensorflow::serving::{anonymous}::AddAssetsTensorsToInputs(tensorflow::StringPiece, const int&, std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >*)':
tensorflow_serving/session_bundle/session_bundle.cc:70:20: error: request for member 'empty' in 'asset_files', which is of non-class type 'const int'
if (!asset_files.empty()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'begin(const int&)'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are:
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
begin(_Tp (&__arr)[_Nm])
^
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int'
for (auto& asset : asset_files) {
^
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
begin(const _Container& __cont) -> decltype(__cont.begin())
^
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:58:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
begin(_Container& __cont) -> decltype(__cont.begin())
^
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = const int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:48:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int'
In file included from /usr/include/c++/4.8/utility:74:0,
from /usr/include/c++/4.8/tuple:38,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
begin(initializer_list<_Tp> __ils) noexcept
^
/usr/include/c++/4.8/initializer_list:89:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:71:24: error: no matching function for call to 'end(const int&)'
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: candidates are:
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
end(_Tp (&__arr)[_Nm])
^
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types '_Tp [_Nm]' and 'const int'
for (auto& asset : asset_files) {
^
In file included from /usr/include/c++/4.8/string:51:0,
from /usr/include/c++/4.8/stdexcept:39,
from /usr/include/c++/4.8/array:38,
from /usr/include/c++/4.8/tuple:39,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
end(const _Container& __cont) -> decltype(__cont.end())
^
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member 'end' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
end(_Container& __cont) -> decltype(__cont.end())
^
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = const int]':
tensorflow_serving/session_bundle/session_bundle.cc:71:24: required from here
/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member 'end' in '__cont', which is of non-class type 'const int'
In file included from /usr/include/c++/4.8/utility:74:0,
from /usr/include/c++/4.8/tuple:38,
from /usr/include/c++/4.8/functional:55,
from /usr/include/c++/4.8/memory:79,
from ./tensorflow_serving/session_bundle/session_bundle.h:21,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
end(initializer_list<_Tp> __ils) noexcept
^
/usr/include/c++/4.8/initializer_list:99:5: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:71:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
for (auto& asset : asset_files) {
^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: error: no matching function for call to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::push_back(<brace-enclosed initializer list>)'
{asset.tensor_binding().tensor_name(), assets_file_tensor});
^
tensorflow_serving/session_bundle/session_bundle.cc:76:69: note: candidates are:
In file included from /usr/include/c++/4.8/vector:64:0,
from external/protobuf/src/google/protobuf/unknown_field_set.h:43,
from external/protobuf/src/google/protobuf/metadata.h:43,
from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/lib/core/error_codes.pb.h:25,
from external/org_tensorflow/tensorflow/core/lib/core/status.h:22,
from ./tensorflow_serving/session_bundle/session_bundle.h:23,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>]
push_back(const value_type& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<std::basic_string<char>, tensorflow::Tensor>&}'
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<std::basic_string<char>, tensorflow::Tensor>; _Alloc = std::allocator<std::pair<std::basic_string<char>, tensorflow::Tensor> >; std::vector<_Tp, _Alloc>::value_type = std::pair<std::basic_string<char>, tensorflow::Tensor>]
push_back(value_type&& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> >::value_type&& {aka std::pair<std::basic_string<char>, tensorflow::Tensor>&&}'
tensorflow_serving/session_bundle/session_bundle.cc: At global scope:
tensorflow_serving/session_bundle/session_bundle.cc:103:39: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:103:39: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:103:48: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc:117:36: error: 'AssetFile' was not declared in this scope
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:117:36: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 1 is invalid
const std::vector<AssetFile>& asset_files,
^
tensorflow_serving/session_bundle/session_bundle.cc:117:45: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc: In function 'tensorflow::Status tensorflow::serving::LoadSessionBundleFromPath(const tensorflow::SessionOptions&, tensorflow::StringPiece, tensorflow::serving::SessionBundle*)':
tensorflow_serving/session_bundle/session_bundle.cc:165:15: error: 'AssetFile' was not declared in this scope
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: suggested alternative:
In file included from ./tensorflow_serving/session_bundle/manifest.pb.h:19:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:29,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/contrib/session_bundle/manifest.pb.h:237:7: note: 'tensorflow::contrib::AssetFile'
class AssetFile : public ::google::protobuf::Message {
^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 1 is invalid
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:165:24: error: template argument 2 is invalid
tensorflow_serving/session_bundle/session_bundle.cc:165:37: error: invalid type in declaration before ';' token
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:170:17: error: expected ';' before 'asset_file'
AssetFile asset_file;
^
tensorflow_serving/session_bundle/session_bundle.cc:171:25: error: the value of 'AssetFile' is not usable in a constant expression
if (!any_asset.Is<AssetFile>()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:165:15: note: 'AssetFile' was not declared 'constexpr'
std::vector<AssetFile> asset_files;
^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: error: no matching function for call to 'google::protobuf::Any::Is() const'
if (!any_asset.Is<AssetFile>()) {
^
tensorflow_serving/session_bundle/session_bundle.cc:171:36: note: candidate is:
In file included from bazel-out/local-fastbuild/genfiles/external/org_tensorflow/tensorflow/core/protobuf/meta_graph.pb.h:32:0,
from ./tensorflow_serving/session_bundle/session_bundle.h:25,
from tensorflow_serving/session_bundle/session_bundle.cc:16:
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template<class T> bool google::protobuf::Any::Is() const
template<typename T> bool Is() const {
^
external/protobuf/src/google/protobuf/any.pb.h:66:29: note: template argument deduction/substitution failed:
tensorflow_serving/session_bundle/session_bundle.cc:174:13: error: 'asset_file' was not declared in this scope
asset_file.descriptor()->full_name(), ". Got: ",
^
tensorflow_serving/session_bundle/session_bundle.cc:178:32: error: 'asset_file' was not declared in this scope
if (!any_asset.UnpackTo(&asset_file)) {
^
tensorflow_serving/session_bundle/session_bundle.cc:182:19: error: request for member 'push_back' in 'asset_files', which is of non-class type 'int'
asset_files.push_back(asset_file);
^
tensorflow_serving/session_bundle/session_bundle.cc:182:29: error: 'asset_file' was not declared in this scope
asset_files.push_back(asset_file);
^
Target //tensorflow_serving/example:mnist_inference_2 failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.822s, Critical Path: 4.54s
From the page you linked: "Before getting started, please complete the prerequisites."
The type Signatures is defined in a header generated by following said prereqs process, so you've either not followed those steps or not followed them correctly – there's no way to tell which just from the compiler errors.

MariaDB C++ Connector compile

I'm trying to compile a simple c++ file that is suppose to use the mariadbc++ connector. For some reason I ran into alot of trouble with that. I get strange error messages. I neither understand them, nor do I know how to fix them.
I did a lot of research, but either nobody else ran into these problems or I just cant find them.
I installed following packages:
mariadb-client
mariadb-client-5.5
mariadb-server
libmariadbclient18
libmysqlclient18
libmysqlcppconn7
libmysqlcppconn-dev
libmariadbclient-dev
libmariadb-dev
I'm on a x64 Ubuntu 14.04 System (well Pinguy OS, but I guess, that doesn't matter)
I tried to build following programm:
#include <my_global.h>
#include <mysql.h>
#include "mysql_driver.h"
int main(int argc, char **argv)
{
sql::mysql::MySQL_Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
driver = sql::mysql::MySQL_Driver::get_mysql_driver_instance();
con = driver->connect("tcp://localhost:3306","root", "herein");
if (!con->isValid()) exit(1);
stmt = con->createStatement();
stmt->execute("use testtb");
stmt->execute("INSERT INTO Testtable(id, label) VALUES (1, 1)");
delete stmt;
delete con;
return 1;
}
And I tried this command:
g++ -lmysqlcppconn -g src/test_mariadb.cpp -o bin/test_mariadb $(mysql_config --cflags) $(mysql_config --libs)
where under in src/ my source files are and in bin/ my binaries.
And finally the Compile Errors I get:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from /usr/include/boost/assert.hpp:82,
from /usr/include/boost/smart_ptr/scoped_ptr.hpp:15,
from /usr/include/boost/scoped_ptr.hpp:14,
from /usr/include/mysql_driver.h:30,
from src/test_mariadb.cpp:3:
/usr/include/c++/4.8/bits/stl_algobase.h:239:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/4.8/bits/stl_algobase.h:260:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from /usr/include/boost/mpl/aux_/begin_end_impl.hpp:21:0,
from /usr/include/boost/mpl/begin_end.hpp:18,
from /usr/include/boost/mpl/iter_fold.hpp:18,
from /usr/include/boost/variant/detail/initializer.hpp:28,
from /usr/include/boost/variant/variant.hpp:31,
from /usr/include/boost/variant.hpp:17,
from /usr/include/cppconn/connection.h:31,
from /usr/include/cppconn/driver.h:30,
from /usr/include/mysql_driver.h:32,
from src/test_mariadb.cpp:3:
/usr/include/boost/mpl/aux_/has_begin.hpp:20:57: error: macro "test" passed 2 arguments, but takes just 1
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_begin, begin, true)
^
In file included from /usr/include/boost/mpl/sequence_tag.hpp:18:0,
from /usr/include/boost/mpl/begin_end.hpp:19,
from /usr/include/boost/mpl/iter_fold.hpp:18,
from /usr/include/boost/variant/detail/initializer.hpp:28,
from /usr/include/boost/variant/variant.hpp:31,
from /usr/include/boost/variant.hpp:17,
from /usr/include/cppconn/connection.h:31,
from /usr/include/cppconn/driver.h:30,
from /usr/include/mysql_driver.h:32,
from src/test_mariadb.cpp:3:
/usr/include/boost/mpl/aux_/has_tag.hpp:20:54: error: macro "test" passed 2 arguments, but takes just 1
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false)
^
In file included from /usr/include/boost/mpl/aux_/O1_size_impl.hpp:20:0,
from /usr/include/boost/mpl/O1_size.hpp:19,
from /usr/include/boost/mpl/iter_fold.hpp:19,
from /usr/include/boost/variant/detail/initializer.hpp:28,
from /usr/include/boost/variant/variant.hpp:31,
from /usr/include/boost/variant.hpp:17,
from /usr/include/cppconn/connection.h:31,
from /usr/include/cppconn/driver.h:30,
from /usr/include/mysql_driver.h:32,
from src/test_mariadb.cpp:3:
/usr/include/boost/mpl/aux_/has_size.hpp:20:1: error: macro "test" passed 2 arguments, but takes just 1
BOOST_MPL_HAS_XXX_TRAIT_DEF(size)
^
In file included from /usr/include/boost/mpl/apply_wrap.hpp:23:0,
from /usr/include/boost/mpl/bind.hpp:27,
from /usr/include/boost/mpl/lambda.hpp:18,
from /usr/include/boost/mpl/iter_fold.hpp:20,
from /usr/include/boost/variant/detail/initializer.hpp:28,
from /usr/include/boost/variant/variant.hpp:31,
from /usr/include/boost/variant.hpp:17,
from /usr/include/cppconn/connection.h:31,
from /usr/include/cppconn/driver.h:30,
from /usr/include/mysql_driver.h:32,
from src/test_mariadb.cpp:3:
/usr/include/boost/mpl/aux_/has_apply.hpp:22:58: error: macro "test" passed 2 arguments, but takes just 1
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_apply, apply, false)
^
In file included from /usr/include/boost/mpl/quote.hpp:23:0,
from /usr/include/boost/mpl/aux_/full_lambda.hpp:25,
from /usr/include/boost/mpl/lambda.hpp:22,
from /usr/include/boost/mpl/iter_fold.hpp:20,
from /usr/include/boost/variant/detail/initializer.hpp:28,
from /usr/include/boost/variant/variant.hpp:31,
from /usr/include/boost/variant.hpp:17,
from /usr/include/cppconn/connection.h:31,
from /usr/include/cppconn/driver.h:30,
from /usr/include/mysql_driver.h:32,
from src/test_mariadb.cpp:3:
/usr/include/boost/mpl/aux_/has_type.hpp:20:55: error: macro "test" passed 2 arguments, but takes just 1
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true)
^
In file included from src/test_mariadb.cpp:1:0:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: error: expected unqualified-id before ‘const’
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: error: expected ‘)’ before ‘const’
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: error: expected ‘)’ before ‘const’
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: error: expected initializer before ‘const’
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: error: expected unqualified-id before ‘const’
max(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: error: expected ‘)’ before ‘const’
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: error: expected ‘)’ before ‘const’
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: error: expected initializer before ‘const’
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from /usr/include/boost/assert.hpp:82,
from /usr/include/boost/smart_ptr/scoped_ptr.hpp:15,
from /usr/include/boost/scoped_ptr.hpp:14,
from /usr/include/mysql_driver.h:30,
from src/test_mariadb.cpp:3:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: error: ‘std::min’ declared as an ‘inline’ variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: error: template declaration of ‘const _Tp& std::min’
/usr/include/c++/4.8/bits/stl_algobase.h:242:7: error: expected primary-expression before ‘if’
if (__comp(__b, __a))
^
/usr/include/c++/4.8/bits/stl_algobase.h:242:7: error: expected ‘}’ before ‘if’
/usr/include/c++/4.8/bits/stl_algobase.h:244:7: error: expected unqualified-id before ‘return’
return __a;
^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: error: ‘max’ declared as an ‘inline’ variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: error: template declaration of ‘const _Tp& max’
/usr/include/c++/4.8/bits/stl_algobase.h:263:7: error: expected primary-expression before ‘if’
if (__comp(__a, __b))
^
/usr/include/c++/4.8/bits/stl_algobase.h:263:7: error: expected ‘}’ before ‘if’
/usr/include/c++/4.8/bits/stl_algobase.h:265:7: error: expected unqualified-id before ‘return’
return __a;
^
/usr/include/c++/4.8/bits/stl_algobase.h:266:5: error: expected declaration before ‘}’ token
}
A header you have included has defined preprocessor macros named min, max and test. These have then conflicted with identifiers used (e.g. for method names) in other header files you have included.
Assuming that those macros have been defined in one of these headers:
#include <my_global.h>
#include <mysql.h>
you could add #undefs before you include mysql_driver.h, e.g.:
#include <my_global.h>
#include <mysql.h>
#undef min
#undef max
#undef test
#include "mysql_driver.h"
You could also consider re-arranging the order in which you include the files, or look into what headers are defining these and see whether the definition of these macros can be disabled.