0

I am trying to install OpenCV 3.1.0 on Ubuntu 16.10 and I'm having some problems. I've been searching for a long time on the net, but I couldn't find an answer. Can you please try to give me some suggestions?

When I run make, I get the following errors (I have deleted some similar errors):

/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h(436): error: identifier "nullptr" is undefined

/usr/include/c++/6/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"

/usr/include/c++/6/bits/exception_ptr.h(64): error: expected a "{"

/usr/include/c++/6/bits/exception_ptr.h(71): error: namespace "std" has no member "rethrow_exception"

/usr/include/c++/6/bits/exception_ptr.h(81): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(88): error: declaration is incompatible with previous "std::current_exception"
(64): here

/usr/include/c++/6/bits/exception_ptr.h(88): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(88): error: expected a ";"

/usr/include/c++/6/bits/exception_ptr.h(89): error: use of a local type to declare a function

/usr/include/c++/6/bits/exception_ptr.h(162): error: use of a local type to declare a function

/usr/include/c++/6/type_traits(71): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(71): error: template parameter "_Tp" may not be redeclared in this scope

/usr/include/c++/6/type_traits(72): error: member "std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/6/type_traits(79): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(79): error: "value_type" has already been declared in the current scope

/usr/include/c++/6/type_traits(84): error: identifier "constexpr" is undefined

/usr/include/c++/6/type_traits(84): error: "_Tp" is not a function or static data member

/usr/include/c++/6/type_traits(126): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(242): error: identifier "char16_t" is undefined

/usr/include/c++/6/type_traits(246): error: identifier "char32_t" is undefined

/usr/include/c++/6/type_traits(246): error: class "std::__is_integral_helper<<error-type>>" has already been defined

/usr/include/c++/6/type_traits(344): error: identifier "__float128" is undefined

/usr/include/c++/6/type_traits(774): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/6/type_traits(795): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(795): error: expected a type specifier

/usr/include/c++/6/type_traits(795): error: function returning function is not allowed

/usr/include/c++/6/type_traits(832): error: function call is not allowed in a constant expression

/usr/include/c++/6/type_traits(832): error: this operator is not allowed in a template argument expression

/usr/include/c++/6/type_traits(843): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/6/type_traits(843): error: expected a type specifier

/usr/include/c++/6/type_traits(843): error: function returning function is not allowed

/usr/include/c++/6/type_traits(886): error: an explicit template argument list is not allowed on this declaration

And these errors seem like compile errors.

Valerio Santinelli
  • 1,592
  • 2
  • 27
  • 45
olivia
  • 1
  • Please, provide full context, what tools did you use ? What steps did you follow before hitting these errors ? – Виталик Бушаев Jul 28 '17 at 10:31
  • 1.I tried to provide full context but the errors are too much than the information so stackoverflow doesn't allow it. 2.I have installed cuda8.0 cudnn5.1 gcc4.9 3. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local.. I don't know what they are and just follow others. – olivia Jul 28 '17 at 11:08
  • It seems that you are not compiling with g++ 4.9, since support for nullptr was added in 4.6.0: http://gcc.gnu.org/gcc-4.6/changes.html – Jonas Jul 28 '17 at 11:33
  • What does the command "g++ --version" return? – Jonas Jul 28 '17 at 11:34
  • g++ (Ubuntu 4.9.4-2ubuntu1) 4.9.4 – olivia Jul 28 '17 at 11:37
  • `constexpr`, `nullptr`, `char16_t` are all C++11, which may not be the default; perhaps `-DCMAKE_CXX_FLAGS=-std=c++11` is missing (wild guess) – valiano Jul 29 '17 at 09:49

0 Answers0