[geos-devel] cygwin Compile Error

Jon Schlueter jon.schlueter at gmail.com
Wed Feb 16 17:15:22 EST 2005


I'm using cygwin under windows xp pro

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,
pascal --enable-nls --without-included-gettext --enable-libgcj
--with-system-zlib --enable-interpreter --enable-threads=posix
--enable-java-gc=boehm --enable-sjlj-exceptions
--disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)

I just pulled down the CVS version of geos from CVS

I configured it and then tried compiling when I hit this error

Jonschl at Endemion ~/geos-cvs/geos/source/geom
$ make
if /bin/bash ../../libtool --mode=compile --tag=CXX g++
-DHAVE_CONFIG_H -I. -I. -I../../source/headers -I../../source/he
aders/geos -I../../source/headers -DGEOS_VERSION=""2.1.1""    -g -O2
-MT CommonBits.lo -MD -MP -MF ".deps/CommonBits.Tpo
" -c -o CommonBits.lo `test -f '../precision/CommonBits.cpp' || echo
'./'`../precision/CommonBits.cpp; \
then mv -f ".deps/CommonBits.Tpo" ".deps/CommonBits.Plo"; else rm -f
".deps/CommonBits.Tpo"; exit 1; fi
 g++ -DHAVE_CONFIG_H -I. -I. -I../../source/headers
-I../../source/headers/geos -I../../source/headers -DGEOS_VERSION=2.
1.1 -g -O2 -MT CommonBits.lo -MD -MP -MF .deps/CommonBits.Tpo -c
../precision/CommonBits.cpp  -DPIC -o .libs/CommonBits.
o
In file included from /usr/include/c++/3.3.3/cmath:51,
                 from /usr/include/c++/3.3.3/bits/locale_facets.tcc:41,
                 from /usr/include/c++/3.3.3/locale:47,
                 from /usr/include/c++/3.3.3/bits/ostream.tcc:37,
                 from /usr/include/c++/3.3.3/ostream:535,
                 from /usr/include/c++/3.3.3/iostream:45,
                 from ../../source/headers/geos/geom.h:20,
                 from ../../source/headers/geos/precision.h:54,
                 from ../precision/CommonBits.cpp:27:
/usr/include/ieeefp.h:185: error: previous declaration of `int isnan(double)'
   with C++ linkage
/usr/include/math.h:125: error: conflicts with new declaration with C linkage
/usr/include/ieeefp.h:186: error: previous declaration of `int isinf(double)'
   with C++ linkage
/usr/include/math.h:126: error: conflicts with new declaration with C linkage
/usr/include/ieeefp.h:187: error: previous declaration of `int finite(double)'
   with C++ linkage
/usr/include/math.h:127: error: conflicts with new declaration with C linkage
/usr/include/ieeefp.h:191: error: previous declaration of `int isnanf(float)'
   with C++ linkage
/usr/include/math.h:240: error: conflicts with new declaration with C linkage
/usr/include/ieeefp.h:192: error: previous declaration of `int isinff(float)'
   with C++ linkage
/usr/include/math.h:241: error: conflicts with new declaration with C linkage
/usr/include/ieeefp.h:193: error: previous declaration of `int finitef(float)'
   with C++ linkage
/usr/include/math.h:242: error: conflicts with new declaration with C linkage
make: *** [CommonBits.lo] Error 1


I did a little bit of digging and found the following patch fixed the
compile error

$ cvs diff -ub
cvs diff: Diffing .
Index: geom.h
===================================================================
RCS file: /home/cvs/postgis/geos/source/headers/geos/geom.h,v
retrieving revision 1.38
diff -u -b -r1.38 geom.h
--- geom.h      15 Feb 2005 17:15:13 -0000      1.38
+++ geom.h      16 Feb 2005 22:25:34 -0000
@@ -22,7 +22,7 @@
 #include <vector>
 #include <algorithm>
 #include <map>
-#include <math.h>
+#include <cmath>
 #include <geos/platform.h>

 using namespace std;


Is this a known issue? or just on my system?

Jon Schlueter



More information about the geos-devel mailing list