Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Trouble with Examples

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Trouble with Examples


Chronological Thread 
  • From: Joachim Reichel <>
  • To:
  • Subject: Re: [cgal-discuss] Trouble with Examples
  • Date: Thu, 04 Jun 2009 18:42:09 +0200

Hi,

> Hello - This is my first post to the list. I feel bad taking your
> time with my very beginner questions as I am new to both CGAL and C++.
> Most of my programming experience is with scripting languages like
> Python and VBA, however, the CGAL python bindings just don't have the
> functionality I need so I am going to delve into C++. I am running
> Ubuntu 9.04 with the Eclipse IDE with the CDT plug in. I installed
> libcgal3, libcgal-dev and libcgal-demo from:
>
> ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/debian/archive/libcgal-demo_3.4-1_all.deb
> ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/debian/archive/libcgal-dev_3.4-1_i386.deb
> ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/debian/archive/libcgal3_3.4-1_i386.deb

Note that these packages are for Debian sid, and not for Ubuntu 9.04.
There are good chances that they work, but there might also be strange
problems.

> Now on to my problem. I create a new C++ project in Eclipse, add
> "/usr/include/CGAL" to the includes, and create a new file called
> test.cpp with the code below in it. Then I save and build, and get
> the errors shown below. It looks like it has something to do with GMP
> but I have it installed and I am not sure what else to look for or
> what the errors mean.
[...]
> make all
> Building file: ../src/testing.cpp
> Invoking: GCC C++ Compiler
> g++ -I/usr/include/CGAL -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
> -MF"src/testing.d" -MT"src/testing.d" -o"src/testing.o"
> "../src/testing.cpp"
> In file included from /usr/include/CGAL/mpz_class.h:29,
> from /usr/include/CGAL/gmpxx.h:47,
> from /usr/include/CGAL/number_type_basic.h:91,
> from /usr/include/CGAL/basic.h:36,
> from /usr/include/CGAL/Cartesian/Cartesian_base.h:28,
> from /usr/include/CGAL/Simple_cartesian.h:28,
> from
> /usr/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:28,
> from ../src/testing.cpp:10:
> /usr/include/CGAL/gmpxx_coercion_traits.h:43: error: ‘::__gmp_expr’
> has not been declared
[...]

The problem is -I/usr/include/CGAL. Note that the include directives for
CGAL's header files start with "CGAL/", so -I/usr/include would be
correct. But that's the default anyway, so you don't need it at all.

Adding -I/usr/include/CGAL causes a file name lookup problem between
<CGAL/gmpxx.h> from CGAL and <gmpxx.h> from GMP, which results in the
shown error messages.

Joachim



Archive powered by MHonArc 2.6.16.

Top of Page