Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] cgal with omnet: compilation problem because of macros

Subject: CGAL users discussion list

List archive

[cgal-discuss] cgal with omnet: compilation problem because of macros


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] cgal with omnet: compilation problem because of macros
  • Date: Fri, 18 Jul 2008 13:58:00 +0200 (CEST)

Hi,

I'm trying to use the cgal library within the omnet network simulator.
I get lot of compile errors because of macros when including
cgal headers in my files.

Here's a partial snapshot of what I get:

------
g++ -c -O2 -DNDEBUG=1 -DWITH_PARSIM -DWITH_NETBUILDER
-I/opt/omnetpp/include
txc1.cc
In file included from /usr/include/CGAL/gmpxx.h:43,
from /usr/include/CGAL/number_type_basic.h:91,
from /usr/include/CGAL/basic.h:35,
from /usr/include/CGAL/Cartesian/Cartesian_base.h:29,
from /usr/include/CGAL/Cartesian.h:27,
from txc1.cc:7:
/usr/include/gmpxx.h:3103:62: error: macro "sgn" passed 2 arguments, but takes
just 1
------


I've tried to place #undef sgn in gmpxx.h, but there are still problems
(maybe because the macro is used somewhere, and I'm undefining it).
Here's another partial snapshot of the errors:

------
In file included from /usr/include/CGAL/number_type_basic.h:68,
from /usr/include/CGAL/basic.h:35,
from /usr/include/CGAL/Cartesian/Cartesian_base.h:29,
from /usr/include/CGAL/Cartesian.h:27,
from txc1.cc:7:
/usr/include/CGAL/utils_classes.h:65: error: expected unqualified-id before
‘{’ token
/usr/include/CGAL/utils_classes.h:66: error: ‘c_’ was not declared in this
scope
/usr/include/CGAL/utils_classes.h:66: error: a function call cannot appear in
a
constant-expression
/usr/include/CGAL/utils_classes.h:66: error: expected ‘;’ before ‘{’
token
/usr/include/CGAL/utils_classes.h:67: error: expected `;' before ‘NT’
/usr/include/CGAL/utils_classes.h:75: error: expected unqualified-id before
‘{’ token
/usr/include/CGAL/utils_classes.h:76: error: ‘c_’ was not declared in this
scope
/usr/include/CGAL/utils_classes.h:76: error: a function call cannot appear in
a
constant-expression
/usr/include/CGAL/utils_classes.h:76: error: expected ‘;’ before ‘{’
token
/usr/include/CGAL/utils_classes.h:77: error: expected `;' before ‘NT’
------


I'm working under ubuntu linux, g++ version 4.2.3.
What am I missing? Is there a way to override this problem?

Thanks in advance.

Regards, Paolo


  • [cgal-discuss] cgal with omnet: compilation problem because of macros, paolo.masci, 07/18/2008

Archive powered by MHonArc 2.6.16.

Top of Page