我希望能够在我的电脑上执行程序。我使用Macports安装CGAL,我不知道下一步如何继续。谁能告诉我如何执行该程序,我拼命地运行下面的程序,但不知道如何:在OS X上运行CGAL C++程序?
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;
int main()
{
Point_2 points[5] = { Point_2(0,0), Point_2(10,0), Point_2(10,10), Point_2(6,5), Point_2(4,1) };
Point_2 result[5];
Point_2 *ptr = CGAL::convex_hull_2(points, points+5, result);
std::cout << ptr - result << " points on the convex hull:" << std::endl;
for(int i = 0; i < ptr - result; i++){
std::cout << result[i] << std::endl;
}
return 0;
}
这只适用于文件名为* .C或* .cpp的文件,它将忽略名为* .cc或* .cxx或其他文件的文件。 – 2014-12-08 08:53:08
“cgal_create_CMakeLists”不是现代版吗? 'cgal_create_cmake_script'只知道Qt3 ... – 2014-12-08 09:03:36
[确实](http://doc.cgal.org/latest/Manual/installation.html#title38) – sloriot 2014-12-08 12:24:35