[geos-devel] cygwin Compile Error
Jon Schlueter
jon.schlueter at gmail.com
Thu Feb 17 13:24:59 EST 2005
update,
I found multiple math.h includes but the only thing that I could find
that would get it to compile under cygwin was to make ieeefp.h extern
"C" with the following
Index: geos/platform.h.in
===================================================================
RCS file: /home/cvs/postgis/geos/source/headers/geos/platform.h.in,v
retrieving revision 1.6
diff -u -b -r1.6 platform.h.in
--- geos/platform.h.in 30 Nov 2004 13:05:59 -0000 1.6
+++ geos/platform.h.in 17 Feb 2005 18:35:49 -0000
@@ -11,7 +11,10 @@
#undef HAVE_IEEEFP_H
#ifdef HAVE_IEEEFP_H
+extern "C"
+{
#include <ieeefp.h>
+};
#endif
and I'm not totally sure of the ramifications of this change to other platforms
it is compiling and passes the tests with this change
Thanks
Jon Schlueter
On Thu, 17 Feb 2005 10:43:43 +0100, strk at refractions.net
<strk at refractions.net> wrote:
> I've applied your patch.
> Thanks.
> --strk;
>
> On Wed, Feb 16, 2005 at 05:15:22PM -0500, Jon Schlueter wrote:
> > 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
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at geos.refractions.net
> > http://geos.refractions.net/mailman/listinfo/geos-devel
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
>
More information about the geos-devel
mailing list