OS X埃爾卡皮坦10.11.2 安裝CGAL庫(2.3.4版本)如何在Mac上編譯CGAL程序?通過MacPorts的
我有一個文件(/Users/Arseniy/Desktop/vec.cpp):
#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;
}
而且我找到了CGAL庫的頭文件(/ usr/local/include/CGAL)。我發現錯誤: 「ld:library not found for --dll」找不到ld:找不到庫文件,找不到 - lCGAL 鐺:錯誤:連接命令,退出代碼爲1(使用-v看看調用)失敗
我是很新,GCC這個問題似乎很容易給你,但我在這裏學習
。感謝您的關注和幫助!
因此,我用CGAL庫的h文件將文件vec.cpp替換爲(/ usr/local/include/CGAL)文件夾。現在gcc只給我一個錯誤:vec.cpp:2:10:致命錯誤: 'CGAL/Exact_predicates_inexact_constructions_kernel.h'文件未找到 #include但是這個文件實際上存在。 ^ 生成1個錯誤。 –