Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Linking problems newbie

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Linking problems newbie


Chronological Thread 
  • From: Philipp Moeller <>
  • To:
  • Subject: Re: [cgal-discuss] Linking problems newbie
  • Date: Tue, 11 Sep 2012 17:40:42 +0200
  • Organization: GeometryFactory

sebitas
<>
writes:

> Hello I installed cgal with macports and I was triying to run this example
> I
> found:
> #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;
> return 0;
> }
>
> Nevertheless I get this linking errors .I am using xcode 4.3.2 and os 10.7.4
> . Regards
>
> Undefined symbols for architecture x86_64:
> "___gmpq_init", referenced from:
> CGAL::Gmpq_rep::Gmpq_rep()in main.o
> "___gmpq_clear", referenced from:
> CGAL::Gmpq_rep::~Gmpq_rep()in main.o
> "___gmpq_set_d", referenced from:
> CGAL::Gmpq::Gmpq(double)in main.o
> "___gmpq_sub", referenced from:
> CGAL::Gmpq::operator-=(CGAL::Gmpq const&)in main.o
> "___gmpq_mul", referenced from:
> CGAL::Gmpq::operator*=(CGAL::Gmpq const&)in main.o
> "___gmpq_cmp", referenced from:
> CGAL::Gmpq::operator<(CGAL::Gmpq const&) constin main.o
> "___gmpq_equal", referenced from:
> CGAL::Gmpq::operator==(CGAL::Gmpq const&) constin main.o
> ld: symbol(s) not found for architecture x86_64
> collect2: ld returned 1 exit status

You are not linking to GMP although macports ships a gmp enabled CGAL
installation. To add an additional library within XCode:
Go to Project -> Edit Project -> Linking -> Other Linker Flags

and add -L/path/to/gmp/lib/ -lgmp



Archive powered by MHonArc 2.6.18.

Top of Page