[Gdal-dev] building gdal for OpenZaurus

Frank Warmerdam warmerdam at pobox.com
Thu Aug 24 11:01:58 EDT 2006


Yan Seiner wrote:
> I am trying to cross-compile gdal for OpenZaurus.  I am using the 
> development toolchain (3.5.4.2-rc2).  The build fails with:
> 
> |  arm-linux-g++ -march=armv5te -mtune=xscale -Wall 
> -I/home/local/zaurus/tmp/staging/arm-linux/include 
> -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 
> -fpermissive -DOGR_ENABLED 
> -I/home/local/zaurus/tmp/staging/arm-linux/include 
> -I/home/local/zaurus/tmp/work/armv5te-linux/gdal-1.3.2-r1/gdal-1.3.2/port 
> -c cpl_strtod.cpp  -fPIC -DPIC -o .libs/cpl_strtod.o
> | cpl_strtod.cpp:239: error: declaration of `double nan(const char*)' 
> throws different exceptions
> | /home/local/zaurus/tmp/staging/arm-linux/include/bits/mathcalls.h:225: 
> error: than previous declaration `double nan(const char*) throw ()'
> | cpl_strtod.cpp:249: error: declaration of `float nanf(const char*)' 
> throws different exceptions
> | /home/local/zaurus/tmp/staging/arm-linux/include/bits/mathcalls.h:225: 
> error: than previous declaration `float nanf(const char*) throw ()'
> 
> Can anyone shed some light on this?  I am pretty much out of my depth on 
> these types of errors....

Yan,

The problem appears to be that cpl_strtod.cpp is providing a declaration
for nan() that conflicts with the system one.  The code tries to avoid
this by only declaring it if the HAVE_DECL_NAN is unset or zero in
cpl_config.h (as set by configure), but it seems that configure on your
platform has not correctly set this item.

I don't know how to fix configure, but the quick fix for you would be
to edit gdal/port/cpl_config.h and change

#define HAVE_DECL_NAN 0

to

#define HAVE_DECL_NAN 1

I suspect the problem relates to cross compiling, something I have never
tried myself with GDAL.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list