无法编译CGAL代码

3

我无法从CGAL文档编译此代码,出现以下错误:

$ 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’

我从apt上安装了libcgal-dev、libcgal-demo、g++和cmake软件。G++版本是5.4.0-6ubuntu1~16.04.9。


1
这确实是一个奇怪的错误,因为size_typeTriangulation_2.h中已经定义了。很抱歉我不能提供更多帮助,但如果您查看该文件,可能会发现问题所在。 - John Perry
1个回答

2

C/C++对版本错误并不清楚,这个代码示例来自CGAL 4.12,而我的库是4.7。

为了稳定地获取最新的libboost版本,我不得不升级我的linux到18.04,然后我使用了libcgal 4.11,它来自官方仓库,以便更少的编译和维护开销。


1
请在此处引用您使用的版本 - LucasMation

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接