cgal with omnet: compilation problem because of macros

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cgal with omnet: compilation problem because of macros

paolo.masci
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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss