[GRASS-user] Unable to load gdal library error

Daniel Victoria daniel.victoria at gmail.com
Sat Sep 25 15:20:03 EDT 2010

On Sat, Sep 25, 2010 at 7:57 AM, Glynn Clements
<glynn at gclements.plus.com> wrote:
> Daniel Victoria wrote:
>> It's strange cause I can use gdalinfo and gdal_translate on the SRTM
>> tif tiles and last night I patched them using gdal_merge.py. Also,
>> r.in.gdal works fine. And I can run r.info on the tiles imported using
>> r.external. But I can't display them or query the values (r.what also
>> gives ERROR: Unable to load GDAL library).
> That error message indicates a failure to load the GDAL library at run
> time via dlopen(). r.in.gdal is linked against GDAL, and r.info
> doesn't need access to the raster data. You will only get the error
> from modules which attempt to access the raster data for a "linked"
> map created with r.external.
> The code which loads the library attempts to dlopen() each of
> following names in turn:
>        libgdal.1.1.so
>        gdal.1.0.so
>        gdal.so.1.0
>        libgdal.so.1
>        libgdal.so
> If none of the attempts succeed, you get the above error.
> The library must be listed in /etc/ld.so.cache (generated by ldconfig)
> or in one of the directories in $LD_LIBRARY_PATH. Also, it must have
> complete dependency information, and all of its dependencies must be
> satisfied.

I guess it's a library naming problem then because what I have inside
ld.so.chache is:

daniel at xadrez:/etc$ sudo ldconfig -p | grep gdal
	libgdal1.7.0.so.1 (libc6) => /usr/lib/libgdal1.7.0.so.1
	libgdal1.7.0.so (libc6) => /usr/lib/libgdal1.7.0.so
	libgdal1.6.0.so.1 (libc6) => /usr/lib/libgdal1.6.0.so.1
daniel at xadrez:/etc$

Also, I don't have any of the lib names mentioned by Glynn in
/usr/lib, as you can see bellow.

daniel at xadrez:/usr/lib$ ls *gdal*
libgdal1.6.0.so.1       libgdal1.7.0.a   libgdal1.7.0.so.1
libgdal1.6.0.so.1.13.3  libgdal1.7.0.so  libgdal1.7.0.so.1.14.2

gdal_GRASS.so  ogr_GRASS.so

gdal_GRASS.so  ogr_GRASS.so

So, by linking libgdal.1.1.so to libgdal1.7.0.so everything came back
to normal... Well, sort of... Now, when I try r.what on the raster I

WARNING: category support for [srtm_21_12] in mapset [PERMANENT] missing
ERROR: Unable to read category file of raster map <srtm_21_12> in

For the record, this is part of the r.info output of the srtm tile:

Type of Map:  raster               Number of Categories: ??              |
 |   Data Type:    CELL                                                       |
 |   Rows:         6001                                                       |
 |   Columns:      6001                                                       |
 |   Total Cells:  36012001


> Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list