Ticket #1587 (new defect)
Error compiling gdal-grass against gdal 1.4.1
| Reported by: | perrygeo | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | ConfigBuild | Version: | 1.4.1 |
| Severity: | normal | Keywords: | grass |
| Cc: | warmerdam, neteler |
Description
Using gdal 1.4.1 and gdal-grass 1.3.2
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
Mateusz writes: It seems prototype of function pointer has changed and first parameter has been redefined from non-const to const.
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 ;-)
Mateusz writes: Yes, that will work, but probably it also will break backward compatibility, I suppose.

