Installation of OpenGL under Cygwin - opengl

I want to install the OpenGL library under CygWin.
I added the Cygwin packages: tiff-opengl,libQtOpenGL4,libQtOpenGl4-devel. Probably I don't need the last 2 packeges- I installed them to try to run the OpenGL.
The program that I want to comile using OpenGL, named test15.c is:
#include <GL/gl.h>
#include <GL/glut.h>
void display()
{
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutDisplayFunc(display);
glutMainLoop();
}
However, I've got all these error messages.
User#User-PC ~/toto
$ gcc -o test15.exe test15.c -lopengl32 -lglu32 -lglut32
In file included from /usr/include/GL/freeglut_std.h:129:0,
from /usr/include/GL/glut.h:17,
from test15.c:2:
/usr/include/w32api/GL/glu.h:68:79: error: expected ‘)’ before ‘*’ token
void APIENTRY gluQuadricCallback(GLUquadric *qobj,GLenum which,void (CALLBACK *fn)());
^
/usr/include/w32api/GL/glu.h:78:79: error: expected ‘)’ before ‘*’ token
void APIENTRY gluTessCallback(GLUtesselator *tess,GLenum which,void (CALLBACK *fn)());
^
/usr/include/w32api/GL/glu.h:94:75: error: expected ‘)’ before ‘*’ token
void APIENTRY gluNurbsCallback(GLUnurbs *nobj,GLenum which,void (CALLBACK *fn)());
^
/usr/include/w32api/GL/glu.h:96:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUquadricErrorProc)(GLenum);
^
/usr/include/w32api/GL/glu.h:97:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessBeginProc)(GLenum);
^
/usr/include/w32api/GL/glu.h:98:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEdgeFlagProc) (GLboolean);
^
/usr/include/w32api/GL/glu.h:99:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessVertexProc)(void *);
^
/usr/include/w32api/GL/glu.h:100:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEndProc)(void);
^
/usr/include/w32api/GL/glu.h:101:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessErrorProc)(GLenum);
^
/usr/include/w32api/GL/glu.h:102:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessCombineProc)(GLdouble[3],void*[4],GLfloat[4],void**);
^
/usr/include/w32api/GL/glu.h:103:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessBeginDataProc)(GLenum,void *);
^
/usr/include/w32api/GL/glu.h:104:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEdgeFlagDataProc) (GLboolean,void *);
^
/usr/include/w32api/GL/glu.h:105:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessVertexDataProc)(void *,void *);
^
/usr/include/w32api/GL/glu.h:106:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessEndDataProc)(void *);
^
/usr/include/w32api/GL/glu.h:107:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessErrorDataProc)(GLenum,void *);
^
/usr/include/w32api/GL/glu.h:108:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUtessCombineDataProc)(GLdouble[3],void*[4],GLfloat[4],void**,void*);
^
/usr/include/w32api/GL/glu.h:109:24: error: expected ‘)’ before ‘*’ token
typedef void (CALLBACK *GLUnurbsErrorProc)(GLenum);
^
What can I do to be able to compile the code using OpenGL?

Related

Error when #include <chrono> in c++14/c++17

I'm trying to include chrono in my project and need support of c++14.
But when I compile it in c++14/c++17, errors occurred.
Code:
#include<chrono>
int main(){return 0;}
Compile it:
gcc test.cc -lstdc++ -std=c++14
Error:
In file included from /usr/include/c++/9/chrono:38,
from test.cc:1:
/usr/include/c++/9/bits/parse_numbers.h:51:50: error: expected template-name before ‘<’ token
51 | struct _Digit<_Base, '0'> : integral_constant<unsigned, 0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:51:50: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:57:50: error: expected template-name before ‘<’ token
57 | struct _Digit<_Base, '1'> : integral_constant<unsigned, 1>
| ^
/usr/include/c++/9/bits/parse_numbers.h:57:50: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:63:43: error: expected template-name before ‘<’ token
63 | struct _Digit_impl : integral_constant<unsigned, _Val>
| ^
/usr/include/c++/9/bits/parse_numbers.h:63:43: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:151:51: error: expected template-name before ‘<’ token
151 | struct _Digit<_Base, '\''> : integral_constant<unsigned, 0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:151:51: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:159:28: error: ‘integral_constant’ does not name a type
159 | using __ull_constant = integral_constant<unsigned long long, _Val>;
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/parse_numbers.h:167:4: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
167 | = __ull_constant<__next::value * (__valid_digit{} ? _Base : 1ULL)>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:167:52: error: expected unqualified-id before ‘?’ token
167 | = __ull_constant<__next::value * (__valid_digit{} ? _Base : 1ULL)>;
| ^
/usr/include/c++/9/bits/parse_numbers.h:174:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
174 | using type = __ull_constant<__valid_digit::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:182:42: error: expected template-name before ‘<’ token
182 | struct _Power<_Base> : __ull_constant<0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:182:42: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:195:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
195 | using type = __ull_constant<_Pow * __digit::value + __next::type::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:196:22: error: ‘type’ has not been declared
196 | static_assert((type::value / _Pow) == __digit::value,
| ^~~~
/usr/include/c++/9/bits/parse_numbers.h:210:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
210 | using type = __ull_constant<_Digit<_Base, _Dig>::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:220:21: error: expected template-name before ‘<’ token
220 | : __ull_constant<0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:220:21: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:268:20: error: expected template-name before ‘<’ token
268 | : conditional_t<(_Val <= std::numeric_limits<_IntType>::max()),
| ^
/usr/include/c++/9/bits/parse_numbers.h:268:20: error: expected ‘{’ before ‘<’ token
#root ➜ proof_of_work git(master)  gcc test.cc -lstdc++ -std=c++14
In file included from /usr/include/c++/9/chrono:38,
from test.cc:1:
/usr/include/c++/9/bits/parse_numbers.h:51:50: error: expected template-name before ‘<’ token
51 | struct _Digit<_Base, '0'> : integral_constant<unsigned, 0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:51:50: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:57:50: error: expected template-name before ‘<’ token
57 | struct _Digit<_Base, '1'> : integral_constant<unsigned, 1>
| ^
/usr/include/c++/9/bits/parse_numbers.h:57:50: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:63:43: error: expected template-name before ‘<’ token
63 | struct _Digit_impl : integral_constant<unsigned, _Val>
| ^
/usr/include/c++/9/bits/parse_numbers.h:63:43: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:151:51: error: expected template-name before ‘<’ token
151 | struct _Digit<_Base, '\''> : integral_constant<unsigned, 0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:151:51: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:159:28: error: ‘integral_constant’ does not name a type
159 | using __ull_constant = integral_constant<unsigned long long, _Val>;
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/parse_numbers.h:167:4: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
167 | = __ull_constant<__next::value * (__valid_digit{} ? _Base : 1ULL)>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:167:52: error: expected unqualified-id before ‘?’ token
167 | = __ull_constant<__next::value * (__valid_digit{} ? _Base : 1ULL)>;
| ^
/usr/include/c++/9/bits/parse_numbers.h:174:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
174 | using type = __ull_constant<__valid_digit::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:182:42: error: expected template-name before ‘<’ token
182 | struct _Power<_Base> : __ull_constant<0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:182:42: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:195:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
195 | using type = __ull_constant<_Pow * __digit::value + __next::type::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:196:22: error: ‘type’ has not been declared
196 | static_assert((type::value / _Pow) == __digit::value,
| ^~~~
/usr/include/c++/9/bits/parse_numbers.h:210:20: error: ‘__ull_constant’ does not name a type; did you mean ‘__builtin_constant_p’?
210 | using type = __ull_constant<_Digit<_Base, _Dig>::value>;
| ^~~~~~~~~~~~~~
| __builtin_constant_p
/usr/include/c++/9/bits/parse_numbers.h:220:21: error: expected template-name before ‘<’ token
220 | : __ull_constant<0>
| ^
/usr/include/c++/9/bits/parse_numbers.h:220:21: error: expected ‘{’ before ‘<’ token
/usr/include/c++/9/bits/parse_numbers.h:268:20: error: expected template-name before ‘<’ token
268 | : conditional_t<(_Val <= std::numeric_limits<_IntType>::max()),
| ^
/usr/include/c++/9/bits/parse_numbers.h:268:20: error: expected ‘{’ before ‘<’ token
Besides:
no error when using c++11.
use clang++ also has same problem
I compile it on wsl(ubuntu 20.04)
So how to fix it?

Errors compiling Boost segment_utils.hpp

I would like to use the intersect_segments method of the Boost segment utils, which can be found here: http://www.boost.org/doc/libs/1_59_0/libs/polygon/doc/gtl_segment_concept.htm
I also have followed and implemented the code that maps the Point and Segment structs to the Boost.Polygon concepts: http://www.boost.org/doc/libs/1_59_0/libs/polygon/doc/voronoi_basic_tutorial.htm
However, when I include <boost/polygon/segment_utils.hpp> I get many errors during compiling:
In file included from /usr/include/boost/polygon/segment_utils.hpp:16:0,
from test.cpp:17:
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:17:49: error: expected template-name before '<' token
class line_intersection : public scanline_base<Unit> {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:17:49: error: expected '{' before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:17:49: error: expected unqualified-id before '<' token
In file included from /usr/include/boost/polygon/segment_utils.hpp:16:0,
from test.cpp:17:
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:947:40: error: expected template-name before '<' token
class scanline : public scanline_base<Unit> {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:947:40: error: expected '{' before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:947:40: error: expected unqualified-id before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1472:22: error: expected nested-name-specifier before 'scanline_base'
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1472:22: error: expected ';' at end of member declaration
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1472:35: error: expected unqualified-id before '<' token
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1475:48: error: 'half_edge' does not name a type
void operator()(result_type& result, const half_edge& edge, const key_type& left, const key_type& right) {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp: In member function 'void boost::polygon::merge_output_functor<Unit>::operator()(result_type&, const int&, const key_type&, const key_type&)':
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1476:26: error: 'half_edge' was not declared in this scope
typename std::pair<half_edge, int> elem;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1476:40: error: template argument 1 is invalid
typename std::pair<half_edge, int> elem;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1476:42: error: 'elem' in namespace 'std' does not name a type
typename std::pair<half_edge, int> elem;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1477:7: error: 'elem' was not declared in this scope
elem.first = edge;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1479:15: error: request for member 'second' in 'edge', which is of non-class type 'const int'
if(edge.second < edge.first) elem.second *= -1;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1479:29: error: request for member 'first' in 'edge', which is of non-class type 'const int'
if(edge.second < edge.first) elem.second *= -1;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1480:10: error: 'boost::polygon::merge_output_functor<Unit>::scanline_base {aka int}' is not a template
if(scanline_base<Unit>::is_vertical(edge)) elem.second *= -1;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1480:10: error: 'scanline_base' is not a class, namespace, or enumeration
/usr/include/boost/polygon/detail/scan_arbitrary.hpp: At global scope:
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1491:46: error: expected template-name before '<' token
class property_merge : public scanline_base<Unit> {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1491:46: error: expected '{' before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:1491:46: error: expected unqualified-id before '<' token
In file included from /usr/include/boost/polygon/segment_utils.hpp:16:0,
from test.cpp:17:
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2490:52: error: expected template-name before '<' token
class arbitrary_boolean_op : public scanline_base<Unit> {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2490:52: error: expected '{' before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2490:52: error: expected unqualified-id before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp: In function 'bool boost::polygon::test_arbitrary_boolean_op(stream_type&)':
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2653:5: error: 'polygon_set_data' was not declared in this scope
polygon_set_data<Unit> psd;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2653:26: error: expected primary-expression before '>' token
polygon_set_data<Unit> psd;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2653:28: error: 'psd' was not declared in this scope
polygon_set_data<Unit> psd;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2657:26: error: expected primary-expression before '>' token
polygon_set_data<Unit> psd2;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2657:28: error: 'psd2' was not declared in this scope
polygon_set_data<Unit> psd2;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2660:17: error: 'polygon_data' was not declared in this scope
std::vector<polygon_data<Unit> > pv;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2660:34: error: template argument 1 is invalid
std::vector<polygon_data<Unit> > pv;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2660:34: error: template argument 2 is invalid
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2660:36: error: expected unqualified-id before '>' token
std::vector<polygon_data<Unit> > pv;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2661:5: error: 'pv' was not declared in this scope
pv.clear();
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2663:26: error: expected primary-expression before '>' token
polygon_set_data<Unit> psd3;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2663:28: error: 'psd3' was not declared in this scope
polygon_set_data<Unit> psd3;
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp: At global scope:
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2710:65: error: expected template-name before '<' token
class arbitrary_connectivity_extraction : public scanline_base<Unit> {
^
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2710:65: error: expected '{' before '<' token
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:2710:65: error: expected unqualified-id before '<' token
In file included from test.cpp:17:0:
/usr/include/boost/polygon/segment_utils.hpp: In function 'typename boost::enable_if<typename boost::polygon::gtl_and<typename boost::polygon::gtl_if<typename boost::polygon::is_segment_concept<typename boost::polygon::geometry_concept<typename std::iterator_traits<_Iterator1>::value_type>::type>::type>::type, typename boost::polygon::gtl_if<typename boost::polygon::is_segment_concept<typename boost::polygon::geometry_concept<GeometryType>::type>::type>::type>::type, void>::type boost::polygon::intersect_segments(std::vector<std::pair<long unsigned int, Segment> >&, SegmentIterator, SegmentIterator)':
/usr/include/boost/polygon/segment_utils.hpp:46:20: error: expected nested-name-specifier before 'scanline_base'
typedef typename scanline_base<Unit>::Point Point;
^
/usr/include/boost/polygon/segment_utils.hpp:46:33: error: expected initializer before '<' token
typedef typename scanline_base<Unit>::Point Point;
^
/usr/include/boost/polygon/segment_utils.hpp:47:20: error: expected nested-name-specifier before 'scanline_base'
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/segment_utils.hpp:47:33: error: expected initializer before '<' token
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/segment_utils.hpp:49:25: error: 'half_edge' was not declared in this scope
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:49:46: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:49:48: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:49:48: error: template argument 2 is invalid
/usr/include/boost/polygon/segment_utils.hpp:50:25: error: the value of 'half_edge' is not usable in a constant expression
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:49:25: note: 'half_edge' was not declared 'constexpr'
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:50:46: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:50:46: note: expected a type, got 'half_edge'
/usr/include/boost/polygon/segment_utils.hpp:50:48: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:50:48: error: template argument 2 is invalid
/usr/include/boost/polygon/segment_utils.hpp:52:14: error: request for member 'reserve' in 'half_edges', which is of non-class type 'int'
half_edges.reserve(std::distance(first, last));
^
/usr/include/boost/polygon/segment_utils.hpp:57:16: error: request for member 'push_back' in 'half_edges', which is of non-class type 'int'
half_edges.push_back(std::make_pair(half_edge(l, h), id_in++));
^
/usr/include/boost/polygon/segment_utils.hpp:59:18: error: request for member 'reserve' in 'half_edges_out', which is of non-class type 'int'
half_edges_out.reserve(half_edges.size());
^
/usr/include/boost/polygon/segment_utils.hpp:59:37: error: request for member 'size' in 'half_edges', which is of non-class type 'int'
half_edges_out.reserve(half_edges.size());
^
/usr/include/boost/polygon/segment_utils.hpp:61:18: error: request for member 'size' in 'half_edges', which is of non-class type 'int'
if (half_edges.size() != 0) {
^
/usr/include/boost/polygon/segment_utils.hpp:63:36: error: request for member 'begin' in 'half_edges', which is of non-class type 'int'
half_edges_out, half_edges.begin(), half_edges.end());
^
/usr/include/boost/polygon/segment_utils.hpp:63:56: error: request for member 'end' in 'half_edges', which is of non-class type 'int'
half_edges_out, half_edges.begin(), half_edges.end());
^
/usr/include/boost/polygon/segment_utils.hpp:66:49: error: request for member 'size' in 'half_edges_out', which is of non-class type 'int'
result.reserve(result.size() + half_edges_out.size());
^
/usr/include/boost/polygon/segment_utils.hpp:67:46: error: request for member 'size' in 'half_edges_out', which is of non-class type 'int'
for (std::size_t i = 0; i < half_edges_out.size(); ++i) {
^
/usr/include/boost/polygon/segment_utils.hpp:68:52: error: invalid types 'int[std::size_t {aka long unsigned int}]' for array subscript
std::size_t id = (std::size_t)(half_edges_out[i].second);
^
/usr/include/boost/polygon/segment_utils.hpp:69:31: error: invalid types 'int[std::size_t {aka long unsigned int}]' for array subscript
Point l = half_edges_out[i].first.first;
^
/usr/include/boost/polygon/segment_utils.hpp:70:31: error: invalid types 'int[std::size_t {aka long unsigned int}]' for array subscript
Point h = half_edges_out[i].first.second;
^
/usr/include/boost/polygon/segment_utils.hpp: In function 'typename boost::enable_if<typename boost::polygon::gtl_and<typename boost::polygon::gtl_if<typename boost::polygon::is_segment_concept<typename boost::polygon::geometry_concept<typename std::iterator_traits<_Iterator1>::value_type>::type>::type>::type, typename boost::polygon::gtl_if<typename boost::polygon::is_segment_concept<typename boost::polygon::geometry_concept<typename SegmentContainer::value_type>::type>::type>::type>::type, void>::type boost::polygon::intersect_segments(SegmentContainer&, SegmentIterator, SegmentIterator)':
/usr/include/boost/polygon/segment_utils.hpp:101:20: error: expected nested-name-specifier before 'scanline_base'
typedef typename scanline_base<Unit>::Point Point;
^
/usr/include/boost/polygon/segment_utils.hpp:101:33: error: expected initializer before '<' token
typedef typename scanline_base<Unit>::Point Point;
^
/usr/include/boost/polygon/segment_utils.hpp:102:20: error: expected nested-name-specifier before 'scanline_base'
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/segment_utils.hpp:102:33: error: expected initializer before '<' token
typedef typename scanline_base<Unit>::half_edge half_edge;
^
/usr/include/boost/polygon/segment_utils.hpp:104:25: error: 'half_edge' was not declared in this scope
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:104:46: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:104:48: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:104:48: error: template argument 2 is invalid
/usr/include/boost/polygon/segment_utils.hpp:105:25: error: the value of 'half_edge' is not usable in a constant expression
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:104:25: note: 'half_edge' was not declared 'constexpr'
std::vector<std::pair<half_edge, segment_id> > half_edges;
^
/usr/include/boost/polygon/segment_utils.hpp:105:46: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:105:46: note: expected a type, got 'half_edge'
/usr/include/boost/polygon/segment_utils.hpp:105:48: error: template argument 1 is invalid
std::vector<std::pair<half_edge, segment_id> > half_edges_out;
^
/usr/include/boost/polygon/segment_utils.hpp:105:48: error: template argument 2 is invalid
/usr/include/boost/polygon/segment_utils.hpp:107:14: error: request for member 'reserve' in 'half_edges', which is of non-class type 'int'
half_edges.reserve(std::distance(first, last));
^
/usr/include/boost/polygon/segment_utils.hpp:112:16: error: request for member 'push_back' in 'half_edges', which is of non-class type 'int'
half_edges.push_back(std::make_pair(half_edge(l, h), id_in++));
^
/usr/include/boost/polygon/segment_utils.hpp:114:18: error: request for member 'reserve' in 'half_edges_out', which is of non-class type 'int'
half_edges_out.reserve(half_edges.size());
^
/usr/include/boost/polygon/segment_utils.hpp:114:37: error: request for member 'size' in 'half_edges', which is of non-class type 'int'
half_edges_out.reserve(half_edges.size());
^
/usr/include/boost/polygon/segment_utils.hpp:116:18: error: request for member 'size' in 'half_edges', which is of non-class type 'int'
if (half_edges.size() != 0) {
^
/usr/include/boost/polygon/segment_utils.hpp:118:36: error: request for member 'begin' in 'half_edges', which is of non-class type 'int'
half_edges_out, half_edges.begin(), half_edges.end());
^
/usr/include/boost/polygon/segment_utils.hpp:118:56: error: request for member 'end' in 'half_edges', which is of non-class type 'int'
half_edges_out, half_edges.begin(), half_edges.end());
^
/usr/include/boost/polygon/segment_utils.hpp:121:49: error: request for member 'size' in 'half_edges_out', which is of non-class type 'int'
result.reserve(result.size() + half_edges_out.size());
^
/usr/include/boost/polygon/segment_utils.hpp:122:46: error: request for member 'size' in 'half_edges_out', which is of non-class type 'int'
for (std::size_t i = 0; i < half_edges_out.size(); ++i) {
^
/usr/include/boost/polygon/segment_utils.hpp:123:31: error: invalid types 'int[std::size_t {aka long unsigned int}]' for array subscript
Point l = half_edges_out[i].first.first;
^
/usr/include/boost/polygon/segment_utils.hpp:124:31: error: invalid types 'int[std::size_t {aka long unsigned int}]' for array subscript
Point h = half_edges_out[i].first.second;
Could this mean that I need to implement the Unit concept as well? If so, how is that done?
Edit: My code is the same as this code: http://www.boost.org/doc/libs/1_61_0/libs/polygon/example/voronoi_basic_tutorial.cpp but then with #include <boost/polygon/segment_utils.hpp> added.
You just need to #include <boost/polygon/polygon.hpp> before including <boost/polygon/segment_utils.hpp>.
/usr/include/boost/polygon/detail/scan_arbitrary.hpp:17:49: error: expected template-name before '<' token
class line_intersection : public scanline_base<Unit> {
^
This error suggests you've defined line_intersection as a macro, because it's complaining about a < token where there isn't one in the source.
But since you haven't shown any code, we can't tell.
Edit after updated question:
This seems to be a a Boost bug, it can be reproduced with a file consisting of nothing but:
#include <boost/polygon/segment_utils.hpp>

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.)

"UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 75: ordinal not in range(128)" using pip for python flandmark

I was trying to install flandmark for Python using pip, but I ended up getting an error that I cannot figure out how to solve or what the error means.
In the Ubuntu terminal, I used this command:
sudo pip install bob.ip.flandmark
When I tried to use that command, it gave me this error:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 75: ordinal not in range(128)
This is the other output from the Ubuntu command line (some are cut off because it won't let me go up any further):
from bob/ip/flandmark/flandmark_detector.h:15,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
In file included from /usr/local/include/opencv/cvaux.h:56:0,
from bob/ip/flandmark/flandmark_detector.h:16,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2673: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/local/include/opencv2/legacy.hpp:2673: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/local/include/opencv2/legacy.hpp:2673: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/local/include/opencv2/legacy.hpp:2718:1: error: expected class-name before ‘{’ token
{
^
/usr/local/include/opencv2/legacy.hpp:2732:23: error: ‘string’ does not name a type
Params( const string& filename );
^
/usr/local/include/opencv2/legacy.hpp:2743:9: error: ‘string’ does not name a type
string filename;
^
/usr/local/include/opencv2/legacy.hpp:2759:17: error: ‘GenericDescriptorMatcher’ was not declared in this scope
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/local/include/opencv2/legacy.hpp:2759:41: error: template argument 1 is invalid
virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;
^
/usr/local/include/opencv2/legacy.hpp:2762:55: error: ‘vector’ has not been declared
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/local/include/opencv2/legacy.hpp:2762:61: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/local/include/opencv2/legacy.hpp:2765:58: error: ‘vector’ has not been declared
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/local/include/opencv2/legacy.hpp:2765:64: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,
^
/usr/local/include/opencv2/legacy.hpp:2771:70: error: ‘vector’ has not been declared
float& bestProb, int& bestMatchIdx, vector<float>& signature );
^
/usr/local/include/opencv2/legacy.hpp:2771:76: error: expected ‘,’ or ‘...’ before ‘<’ token
float& bestProb, int& bestMatchIdx, vector<float>& signature );
^
/usr/local/include/opencv2/legacy.hpp:2785:40: error: ‘string’ does not name a type
CalonderDescriptorExtractor( const string& classifierFile );
^
/usr/local/include/opencv2/legacy.hpp:2796:49: error: ‘vector’ has not been declared
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
^
/usr/local/include/opencv2/legacy.hpp:2796:55: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
^
/usr/local/include/opencv2/legacy.hpp:2803: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/local/include/opencv2/legacy.hpp:2785:5: error: candidate is: cv::CalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const int&)
CalonderDescriptorExtractor( const string& classifierFile );
^
/usr/local/include/opencv2/legacy.hpp:2810:50: error: ‘vector’ has not been declared
vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2810:56: error: expected ‘,’ or ‘...’ before ‘<’ token
vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp: In member function ‘virtual void cv::CalonderDescriptorExtractor<T>::computeImpl(const cv::Mat&, int) const’:
/usr/local/include/opencv2/legacy.hpp:2814:39: error: ‘keypoints’ was not declared in this scope
KeyPointsFilter::runByImageBorder(keypoints, image.size(), BORDER_SIZE);
^
/usr/local/include/opencv2/legacy.hpp:2817:5: error: ‘descriptors’ was not declared in this scope
descriptors.create((int)keypoints.size(), classifier_.classes(), cv::DataType<T>::type);
^
/usr/local/include/opencv2/legacy.hpp:2825:58: error: expected primary-expression before ‘>’ token
classifier_.getSignature( &ipl, descriptors.ptr<T>((int)i));
^
/usr/local/include/opencv2/legacy.hpp: In member function ‘virtual bool cv::CalonderDescriptorExtractor<T>::empty() const’:
/usr/local/include/opencv2/legacy.hpp:2840:24: error: ‘const class cv::RTreeClassifier’ has no member named ‘trees_’
return classifier_.trees_.empty();
^
/usr/local/include/opencv2/legacy.hpp: At global scope:
/usr/local/include/opencv2/legacy.hpp:2864:32: error: ‘vector’ does not name a type
PlanarObjectDetector(const vector<Mat>& pyr, int _npoints=300,
^
/usr/local/include/opencv2/legacy.hpp:2864:38: error: expected ‘,’ or ‘...’ before ‘<’ token
PlanarObjectDetector(const vector<Mat>& pyr, int _npoints=300,
^
/usr/local/include/opencv2/legacy.hpp:2872:30: error: ‘vector’ does not name a type
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/local/include/opencv2/legacy.hpp:2872:36: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/local/include/opencv2/legacy.hpp:2879:30: error: ‘vector’ does not name a type
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2879:36: error: expected ‘,’ or ‘...’ before ‘<’ token
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2879:18: error: ‘virtual void cv::PlanarObjectDetector::train(int)’ cannot be overloaded
virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2872:18: error: with ‘virtual void cv::PlanarObjectDetector::train(int)’
virtual void train(const vector<Mat>& pyr, int _npoints=300,
^
/usr/local/include/opencv2/legacy.hpp:2887:5: error: ‘vector’ does not name a type
vector<KeyPoint> getModelPoints() const;
^
/usr/local/include/opencv2/legacy.hpp:2894:61: error: ‘vector’ has not been declared
bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT vector<Point2f>& corners) const;
^
/usr/local/include/opencv2/legacy.hpp:2894:67: error: expected ‘,’ or ‘...’ before ‘<’ token
bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT vector<Point2f>& corners) const;
^
/usr/local/include/opencv2/legacy.hpp:2895:27: error: ‘vector’ does not name a type
bool operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2895:33: error: expected ‘,’ or ‘...’ before ‘<’ token
bool operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/legacy.hpp:2902:5: error: ‘vector’ does not name a type
vector<KeyPoint> modelPoints;
^
/usr/local/include/opencv2/legacy.hpp:2950:38: error: variable or field ‘cvInitSubdivDelaunay2D’ declared void
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
^
/usr/local/include/opencv2/legacy.hpp:2950:38: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/local/include/opencv2/legacy.hpp:2950:50: error: ‘subdiv’ was not declared in this scope
CVAPI(void) cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );
^
/usr/local/include/opencv2/legacy.hpp:2950: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/opencv/cv.h:63,
from bob/ip/flandmark/flandmark_detector.h:15,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2953:1: error: ‘CvSubdiv2D’ does not name a type
CVAPI(CvSubdiv2D*) cvCreateSubdiv2D( int subdiv_type, int header_size,
^
In file included from /usr/local/include/opencv/cvaux.h:56:0,
from bob/ip/flandmark/flandmark_detector.h:16,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2960: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/opencv/cv.h:63,
from bob/ip/flandmark/flandmark_detector.h:15,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2971:1: error: ‘CvSubdiv2DPoint’ does not name a type
CVAPI(CvSubdiv2DPoint*) cvSubdivDelaunay2DInsert( CvSubdiv2D* subdiv, CvPoint2D32f pt);
^
/usr/local/include/opencv2/legacy.hpp:2976:1: error: ‘CvSubdiv2DPointLocation’ does not name a type
CVAPI(CvSubdiv2DPointLocation) cvSubdiv2DLocate(
^
In file included from /usr/local/include/opencv/cvaux.h:56:0,
from bob/ip/flandmark/flandmark_detector.h:16,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2982:37: error: variable or field ‘cvCalcSubdivVoronoi2D’ declared void
CVAPI(void) cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/local/include/opencv2/legacy.hpp:2982:37: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/local/include/opencv2/legacy.hpp:2982:49: error: ‘subdiv’ was not declared in this scope
CVAPI(void) cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/local/include/opencv2/legacy.hpp:2986:38: error: variable or field ‘cvClearSubdivVoronoi2D’ declared void
CVAPI(void) cvClearSubdivVoronoi2D( CvSubdiv2D* subdiv );
^
/usr/local/include/opencv2/legacy.hpp:2986:38: error: ‘CvSubdiv2D’ was not declared in this scope
/usr/local/include/opencv2/legacy.hpp:2986: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/opencv/cv.h:63,
from bob/ip/flandmark/flandmark_detector.h:15,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2990:1: error: ‘CvSubdiv2DPoint’ does not name a type
CVAPI(CvSubdiv2DPoint*) cvFindNearestPoint2D( CvSubdiv2D* subdiv, CvPoint2D32f pt );
^
In file included from /usr/local/include/opencv/cvaux.h:56:0,
from bob/ip/flandmark/flandmark_detector.h:16,
from bob/ip/flandmark/flandmark_detector.cpp:17:
/usr/local/include/opencv2/legacy.hpp:2995:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DNextEdge( CvSubdiv2DEdge edge )
^
/usr/local/include/opencv2/legacy.hpp:3001:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DRotateEdge( CvSubdiv2DEdge edge, int rotate )
^
/usr/local/include/opencv2/legacy.hpp:3006:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DSymEdge( CvSubdiv2DEdge edge )
^
/usr/local/include/opencv2/legacy.hpp:3011:12: error: ‘CvSubdiv2DEdge’ does not name a type
CV_INLINE CvSubdiv2DEdge cvSubdiv2DGetEdge( CvSubdiv2DEdge edge, CvNextEdgeType type )
^
/usr/local/include/opencv2/legacy.hpp:3019:12: error: ‘CvSubdiv2DPoint’ does not name a type
CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge )
^
/usr/local/include/opencv2/legacy.hpp:3026:12: error: ‘CvSubdiv2DPoint’ does not name a type
CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/bob.ip.flandmark/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nOl3aD-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/bob.ip.flandmark
How would I solve something like this?
Use Python 3 it will solve the problem. the error is because of non ASCI characters and default encoding standards for python 2.7 is not UTF-8, while Python 3 has default encoding standard as UTF-8. so use latest Python 3.

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.