[Gdal-dev] error compiling gdal-grass against latest gdal + potential fix?

Mateusz Loskot mateusz at loskot.net
Fri Apr 20 09:23:09 EDT 2007


Matthew Perry wrote:
> Hey folks,
> 
> I ran into some minor troubles getting gdal-grass plugin (version 
> 1.3.2) installed on gdal:
> 
> ./configure --with-gdal=/usr/local/bin/gdal-config 
> --with-grass=/usr/local/grass-6.3.cvs
> 
> g++ -Wall -fPIC  -DUSE_CPL 
> -DGRASS_GISBASE=\"/usr/local/grass-6.3.cvs\" -I/usr/local/include 
> -I/usr/local/grass-6.3.cvs/include   -c -o grass57dataset.o 
> grass57dataset.cpp grass57dataset.cpp: In static member function
> 'static GDALDataset* GRASSDataset::Open(GDALOpenInfo*)': 
> grass57dataset.cpp:828: error: invalid conversion from 'int
> (*)(char*, int)' to 'int (*)(const char*, int)' 
> grass57dataset.cpp:828: error:   initializing argument 1 of 'int 
> G_set_error_routine(int (*)(const char*, int))' make: ***
> [grass57dataset.o] Error 1

Matthew,

It seems prototype of function pointer has changed and first parameter
has been redefined from non-const to const.

> Is there an updated gdal-grass plugin for 1.4.1 that I'm missing?

AFAIK, not.

> For the record, changing the following lines seems to fix it.
> 
> ------ grass57dataset.cpp: 799 typedef int (*GrassErrorHandler)(const
> char *, int);
> 
> ------  ogrgrassdatasource:91 typedef int (*GrassErrorHandler)(const
> char *, int);
> 
> I can't confirm that the above changes work but at they compile at
> the very least ;-)

Yes, that will work, but probably it also will break backward
compatibility, I suppose.

I think the best would be to submit your proposal as a ticket,
if you don't mind.

Thank you!
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list