[GRASS5] r.in.gdal bug

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Oct 7 15:37:41 EDT 2002


I was compiling the latest CVS version and got the following errors:

  SRC     = /indigo-disk2/grass/checkout/grass/src
  CMD     = /indigo-disk2/grass/checkout/grass/src/CMD
  UNUSED  = /indigo-disk2/grass/checkout/grass/unused
  HEADER  = head.mips-sgi-irix6.2
  ARCH    = mips-sgi-irix6.2
  GISBASE = /indigo-disk2/grass/checkout/grass/dist.mips-sgi-irix6.2
  VERSION = 5.0.1-cvs October 2002
#################################################################
/indigo-disk2/grass/checkout/grass/src/raster/r.in.gdal
  mkdir OBJ.mips-sgi-irix6.2
  make -f OBJ.mips-sgi-irix6.2/make.rules

cc -I/indigo-disk2/grass/checkout/grass/src/include -O3 -n32 -mips3
-I/usr/local/include   -c main.c -o OBJ.mips-sgi-irix6.2/main.o
"main.c", line 169: error(1515): a value of type "int" cannot be assigned
to
          an entity of type "GDALDriverH"
      hDriver = GDALGetDatasetDriver( hDS ); /* needed for AVHRR data */
              ^

"main.c", line 170: error(1164): argument of type "int" is incompatible
with
          parameter of type "const char *"
      if ( strcmp(GDALGetDriverShortName(hDriver),"L1B") !=0 )
                  ^

2 errors detected in the compilation of "main.c".
make: *** [OBJ.mips-sgi-irix6.2/main.o] Error 2

I fixed it by copying over some function prototypes into
src/raster/r.in.gdal/gdalbridge.h from the version of gdalbridge.h that
is included in my GDAL installation, as follows:

--- gdalbridge.h.old	2002-10-07 20:10:16.936634977 +0100
+++ gdalbridge.h.new	2002-10-07 20:08:51.867114351 +0100
@@ -268,12 +268,21 @@
 GDAL_ENTRY GDALDriverH (*pfnGDALGetDriverByName)( const char * ) GDAL_NULL;
 #define GDALGetDriverByName pfnGDALGetDriverByName

+GDAL_ENTRY const char *(*pfnGDALGetDriverShortName)(GDALDriverH) GDAL_NULL;
+#define GDALGetDriverShortName pfnGDALGetDriverShortName
+
+GDAL_ENTRY const char *(*pfnGDALGetDriverLongName)(GDALDriverH) GDAL_NULL;
+#define GDALGetDriverLongName pfnGDALGetDriverLongName
+
 /* ==================================================================== */
 /*      GDALDataset class ... normally this represents one file.        */
 /* ==================================================================== */

 GDAL_ENTRY void (*pfnGDALClose)( GDALDatasetH ) GDAL_NULL;
 #define GDALClose pfnGDALClose
+
+GDAL_ENTRY GDALDriverH (*pfnGDALGetDatasetDriver)( GDALDatasetH ) GDAL_NULL;
+#define GDALGetDatasetDriver pfnGDALGetDatasetDriver

 GDAL_ENTRY int (*pfnGDALGetRasterXSize)( GDALDatasetH ) GDAL_NULL;
 #define GDALGetRasterXSize pfnGDALGetRasterXSize

I hope this is the correct way to fix the error. If so, maybe someone
could add it to the CVS.

Paul





More information about the grass-dev mailing list