gpt4 book ai didi

c++ - 无法编译 CGAL 代码

转载 作者:太空狗 更新时间:2023-10-29 21:33:40 25 4
gpt4 key购买 nike

我无法从 CGAL docs 编译这段代码,出现以下错误:

$ 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

最佳答案

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

我必须将我的 linux 升级到 18.04 才能以稳定的方式获得最新的 libboost 版本,然后我使用了来自 the official repository 的 libcgal 4.11|减少编译和维护库的开销。

关于c++ - 无法编译 CGAL 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50516051/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com