Macports cgal不工作!我该如何修复它
Macports cgal not working! How do I fix it?
这是我在CGAL主页上找到的一个基本示例。我正在尝试编译以下内容:
1 #include <iostream>
2 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
3 #include <CGAL/convex_hull_2.h>
4
5 typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
6 typedef K::Point_2 Point_2;
7
8 int main()
9 {
10 Point_2 points[5] = { Point_2(0,0), Point_2(10,0), Point_2(10,10), Point_2(6,5), Point_2(4,1) };
11 Point_2 result[5];
12
13 Point_2 *ptr = CGAL::convex_hull_2( points, points+5, result );
14 std::cout << ptr - result << " points on the convex hull" << std::endl;
15 return 0;
16 }
但我得到了这个错误:
Demo $> make
[100%] Building CXX object CMakeFiles/helloworld_cgal.dir/helloworld_cgal.cpp.o
In file included from /opt/local/include/CGAL/Bbox_2.h:30,
from /opt/local/include/CGAL/basic_classes.h:30,
from /opt/local/include/CGAL/Cartesian/Cartesian_base.h:28,
from /opt/local/include/CGAL/Simple_cartesian.h:27,
from /opt/local/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:27,
from /Users/carlos/Documents/Code/Demo/helloworld_cgal.cpp:2:
/opt/local/include/CGAL/array.h:81: error: expected nested-name-specifier before ‘...’ token
/opt/local/include/CGAL/array.h:81: error: expected ‘>’ before ‘...’ token
/opt/local/include/CGAL/array.h:83: error: template argument 2 is invalid
/opt/local/include/CGAL/array.h:84: error: expected ‘,’ or ‘...’ before ‘&’ token
/opt/local/include/CGAL/array.h:84: error: ISO C++ forbids declaration of ‘Args’ with no type
/opt/local/include/CGAL/array.h: In function ‘int CGAL::make_array(const T&, int)’:
/opt/local/include/CGAL/array.h:86: error: template argument 2 is invalid
/opt/local/include/CGAL/array.h:86: error: invalid type in declaration before ‘=’ token
/opt/local/include/CGAL/array.h:86: error: ‘args’ was not declared in this scope
/opt/local/include/CGAL/array.h:86: error: expected `}' before ‘...’ token
/opt/local/include/CGAL/array.h:86: error: expected `}' before ‘...’ token
/opt/local/include/CGAL/array.h:86: error: expected ‘,’ or ‘;’ before ‘...’ token
/opt/local/include/CGAL/array.h: At global scope:
/opt/local/include/CGAL/array.h:87: error: expected unqualified-id before ‘return’
/opt/local/include/CGAL/array.h:88: error: expected declaration before ‘}’ token
make[2]: *** [CMakeFiles/helloworld_cgal.dir/helloworld_cgal.cpp.o] Error 1
make[1]: *** [CMakeFiles/helloworld_cgal.dir/all] Error 2
make: *** [all] Error 2
我使用macports安装了cgal。有人知道可能出了什么问题吗这
事实上,构建CGAL和使用CGAL编译时使用的编译器或编译器选项似乎不匹配。可能是macports没有帮助,在安装CGAL时,我对自制软件比macports更幸运。
相关文章:
- 静态数据成员的问题-修复链接错误会导致编译器错误
- Boost Graph Library,修复节点大小
- 函数何时会在c++中包含stack_Unwind_Resume调用
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 如何修复函数样式强制转换或类型构造的预期"("?
- 如何针对特定情况调试和修复此双自由内存损坏问题
- 当使用带有VS2019或VSCode的虚幻引擎4.24.2时,我如何修复这些错误的Intellisense错误
- 如何修复sfml c++代码编译错误
- Python中的for循环与C++有何不同
- 如何修复此iFile以将.txt输出到控制台
- 我收到同义重复编译器错误。我应该如何修复"类型"X"的参数与类型"X"的参数不兼容?
- 如何修复链表类实现的未处理异常0xDDDDDDDD
- 如何修复此错误:className::className的无效使用
- 叮叮当当在修复时插入多个"覆盖"说明符
- 如何修复带有 clang 的参数'args'缺少默认参数的问题?
- 如何修复 Onnx运行时会话>运行问题?
- 当我尝试加载内核模块时,如何修复C++中的这个 malloc() 错误?
- 如何修复编译器警告 C6386 和 C6385?
- 如何修复valgrind启动时的致命错误(与libc6-dbg和libc6-dbg:i386连接)
- Macports cgal不工作!我该如何修复它