[geos-devel] Geos CVS compilation with GCC 4.1, include error

Matthieu DESILE matthieu.desile at free.fr
Mon Mar 20 06:32:30 EST 2006


Hello,

This morning I tried to compile geos from cvs and encountered several
errors of the same nature, where math functions were declared out of
scope (fabs, sin, ...), causing the compilation to abort.

It seems related to the not-inclusion of <cmath>, since its inclusion
gets rid of the errors.

Attached is a patch that includes <cmath> in the sources files that were
causing the compilation to abort.

Matthieu Desile.

PS: Environment :

Linux studio 2.6.15-gentoo-r7 #3 SMP Sat Mar 18 19:33:50 CET 2006 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ GNU/Linux

GCC :

gcc (GCC) 4.1.0 (Gentoo 4.1.0)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-------------- next part --------------
? py-compile
Index: source/noding/Octant.cpp
===================================================================
RCS file: /home/cvs/postgis/geos/source/noding/Octant.cpp,v
retrieving revision 1.5
diff -u -r1.5 Octant.cpp
--- source/noding/Octant.cpp	15 Mar 2006 09:51:12 -0000	1.5
+++ source/noding/Octant.cpp	20 Mar 2006 11:19:13 -0000
@@ -17,6 +17,7 @@
  *
  **********************************************************************/
 
+#include <cmath>
 #include <sstream>
 
 #include <geos/util/IllegalArgumentException.h>
Index: source/operation/buffer/OffsetCurveBuilder.cpp
===================================================================
RCS file: /home/cvs/postgis/geos/source/operation/buffer/OffsetCurveBuilder.cpp,v
retrieving revision 1.31
diff -u -r1.31 OffsetCurveBuilder.cpp
--- source/operation/buffer/OffsetCurveBuilder.cpp	14 Mar 2006 00:19:40 -0000	1.31
+++ source/operation/buffer/OffsetCurveBuilder.cpp	20 Mar 2006 11:19:13 -0000
@@ -19,6 +19,7 @@
  **********************************************************************/
 
 #include <cassert>
+#include <cmath>
 #include <vector>
 
 #include <geos/algorithm/CGAlgorithms.h>
Index: source/operation/buffer/OffsetCurveSetBuilder.cpp
===================================================================
RCS file: /home/cvs/postgis/geos/source/operation/buffer/OffsetCurveSetBuilder.cpp,v
retrieving revision 1.30
diff -u -r1.30 OffsetCurveSetBuilder.cpp
--- source/operation/buffer/OffsetCurveSetBuilder.cpp	14 Mar 2006 00:19:40 -0000	1.30
+++ source/operation/buffer/OffsetCurveSetBuilder.cpp	20 Mar 2006 11:19:13 -0000
@@ -18,6 +18,7 @@
  *
  **********************************************************************/
 
+#include <cmath>
 #include <vector>
 
 #include <geos/algorithm/CGAlgorithms.h>


More information about the geos-devel mailing list