[Gdal-dev] building gdal for OpenZaurus

Mateusz Loskot mateusz at loskot.net
Thu Aug 24 10:54:59 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,

toolchain 3.5.4 includes gcc 2.95, am I right?
This compiler is first quite strict in C++ code compilation.

Could you replace lines 175 - 182 with following:

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdlib> // this is most important!
#include <cstring>

Please, try to compile it now.
If you will get errors about declarations not found, please add
using namespace std;
below these includes.

CPL code is build using C++ compiler, but it includes C headers.
AFAIR, there are some issues in gcc 2.95 and may be 3.0 with
mixing C and C++ headers.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list