[Gdal-dev] Re: build gdal for mingw32 on cygwin

Frank Warmerdam warmerdam at pobox.com
Mon May 12 09:59:38 EDT 2003


Hisaji Ono wrote:
> Hello, Mr. Warmerdam.
> 
>  For R language, GNU-S, there are two packages,
> RGDAL(http://keittlab.biosci.utexas.edu/R/GDAL/) &
> RMap(http://www.maths.lancs.ac.uk/Software/Rmap/), using gdal to display
> Raster & Vector map within R.
> 
>  Currently these packages' binaries are only available for unix(or linux).
> 
>  For cygwin, as you wrote, I could build gdal library on it. However R
> doesn't support Cygwin.
> So I have to build GDAL for mingw32.
>  I've tried to build GDAL for mingw32 on Cygwin as follows.

...

> ../../../port/cpl_vsi.h:172: ISO C++ forbids declaration of `vsi_l_offset'
> with
> 
>    no type
> ../../../port/cpl_vsi.h:172: parse error before `(' token
> make[3]: *** [ogrpgdriver.o] Error 1
> make[3]: Leaving directory
> `/home/Administrator/gdal-1.1.8/ogr/ogrsf_frmts/pg'
> make[2]: *** [default] Error 2
> make[2]: Leaving directory `/home/Administrator/gdal-1.1.8/ogr/ogrsf_frmts'
> make[1]: *** [sublibs] Error 2
> make[1]: Leaving directory `/home/Administrator/gdal-1.1.8/ogr'
> make: *** [ogr-target] Error 2
> 
> 
>  Could you suggest any idea to solve this situation?

Hisaji,

I believe the problem is that since the system isn't Cygwin but is Win32,
the WIN32 macro is defined and various decisions are being made under the
assumption of Visual C++.  For instance, in cpl_port.h, the type __int64
is being used for 64 bit integers.  It seems that "long long" may be
appropriate with the mingw-gcc compiler.  I would suggest you try changing
this section of cpl_port.h:

#ifdef WIN32

#define VSI_LARGE_API_SUPPORTED
typedef __int64          GIntBig;
typedef unsigned __int64 GUIntBig;

#elif HAVE_LONG_LONG
...

to:

#if defined(WIN32) && !defined(HAVE_LONG_LONG)

#define VSI_LARGE_API_SUPPORTED
typedef __int64          GIntBig;
typedef unsigned __int64 GUIntBig;

#elif HAVE_LONG_LONG
...

Of course, it would be more appropriate for me to actually test if the
compiler is VC++, but offhand I am not sure how to do that.

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    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list