[Gdal-dev] grass in 1.2.2 compilation problem

Frank Warmerdam warmerdam at pobox.com
Wed Sep 22 15:46:45 EDT 2004

Steve Halasz wrote:
> Hi,
> I'm attempting to compile 1.2.2 --with-grass against grass 5.7.0. I end
> up with:
> make[2]: Entering directory
> `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2/ogr'
> /bin/sh ../libtool --mode=compile g++ -Wall  -O2
> -DCPL_MULTIPROC_PTHREAD   -Iogrsf_frmts -I. -I../port -I../gcore
> -I../ogr -I../alg   -I../port  -c -o ogrinfo.o ogrinfo.cpp
>  g++ -Wall -O2 -DCPL_MULTIPROC_PTHREAD -Iogrsf_frmts -I. -I../port
> -I../gcore -I../ogr -I../alg -I../port -c ogrinfo.cpp  -fPIC -DPIC -o
> .libs/ogrinfo.o
>  g++ -Wall -O2 -DCPL_MULTIPROC_PTHREAD -Iogrsf_frmts -I. -I../port
> -I../gcore -I../ogr -I../alg -I../port -c ogrinfo.cpp -o ogrinfo.o
>>/dev/null 2>&1
> /bin/sh ../libtool --mode=link  g++  ogrinfo.o ../libgdal.la -o ogrinfo
> g++ ogrinfo.o -o .libs/ogrinfo  ../.libs/libgdal.so /usr/lib/libodbc.so
> /usr/lib/libltdl.so -L/usr/lib -lxerces-c /usr/lib/libjasper.so -lmfhdf
> -ldf -lgif /usr/lib/libjpeg.so -ltiff -lpng -lnetcdf -lcfitsio
> -L/usr/lib/grass57/lib -lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis
> -lgrass_datetime -lz -lpthread -ldl -lpq
> ../.libs/libgdal.so: undefined reference to `G_gisinit_2'
> ../.libs/libgdal.so: undefined reference to `G_check_cell'
> ../.libs/libgdal.so: undefined reference to `I_check_group'
> ../.libs/libgdal.so: undefined reference to `G_get_cell_as_proj4'
> collect2: ld returned 1 exit status
> make[2]: *** [ogrinfo] Error 1
> make[2]: Leaving directory
> `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2/ogr'
> make[1]: *** [ogr-apps] Error 2
> make[1]: Leaving directory
> `/home/steve/projects/qgis/debian/gdal/gdal-1.2.2'
> make: *** [build-stamp] Error 2
> It appears that it is trying to compile the libgrass version. Renaming
> frmts/grass/grass57dataset.cpp to grassdataset.cpp didn't work either. I
> looked for where the logic to decide which to use was and couldn't find
> it.


It does indeed appear that the libgrass version of the code is being used.
I suspect that both versions of the code have been compiled and linked in.
I would suggesting doing a "make clean" and then make again.  If you
reconfigured and rebuilding without a make clean, it is likely that the
old grassdataset.o would still be handing around in the gdal/frmts/o
directory or libgdal.a.

The logic within the gdal/frmts/grass directory is controlled by the
GRASS_SETTING variable which should be either "libgrass" or "grass57+".
You might want to check GDALmake.opt to see if the variable is set properly.

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