Jader Martins
Jader Martins

Reputation: 789

Can't compile CGAL code

I can't compile this code from CGAL docs, got the following error:

$ g++ apply.cpp -lCGAL -I/usr/local/include -o a.out
In file included from /usr/include/CGAL/Constrained_triangulation_2.h:28:0,
                 from /usr/include/CGAL/Constrained_Delaunay_triangulation_2.h:25,
                 from apply.cpp:3:
/usr/include/CGAL/Triangulation_2.h: In instantiation of ‘class CGAL::Triangulation_2<CGAL::Epeck, CGAL::Default>’:
/usr/include/CGAL/Constrained_triangulation_2.h:47:7:   required from ‘class CGAL::Constrained_triangulation_2<CGAL::Epeck, CGAL::Default, CGAL::Exact_intersections_tag>’
/usr/include/CGAL/Constrained_Delaunay_triangulation_2.h:63:7:   required from ‘class CGAL::Constrained_Delaunay_triangulation_2<CGAL::Epeck, CGAL::Default, CGAL::Exact_intersections_tag>’
/usr/include/CGAL/Constrained_triangulation_plus_2.h:64:7:   required from ‘class CGAL::Constrained_triangulation_plus_2<CGAL::Constrained_Delaunay_triangulation_2<CGAL::Epeck, CGAL::Default, CGAL::Exact_intersections_tag> >’
apply.cpp:12:16:   required from here
/usr/include/CGAL/Triangulation_2.h:100:48: error: no type named ‘size_type’ in ‘struct CGAL::Default’

I installed libcgal-dev, libcgal-demo, g++ and cmake from apt. G++ version 5.4.0-6ubuntu1~16.04.9

Upvotes: 3

Views: 361

Answers (1)

Jader Martins
Jader Martins

Reputation: 789

C/C++ isn't clear about version errors, this code example is from CGAL 4.12, my library was 4.7.

I had to upgrade my linux for 18.04 to get a recent libboost version in a stable way, then I used the libcgal 4.11 from the official repository for less overhead compiling and maintaining the library.

Upvotes: 2

Related Questions