[Ubuntu] GDAL compilation

Antonio Valentino antonio.valentino at tiscali.it
Thu Jan 5 15:43:38 EST 2012


Hi Alassane,

Il 05/01/2012 21:23, Alassane Toure ha scritto:
> Dear group,
> I am a first time user of GDAL in Linux (Ubuntu) with a C compiler
> (gcc).  I compiled a program (gdal.h being called) using the following
> command line:
> 
> gcc -o test gdalprogram.c -I /usr/include/gdal
> 
> The following error messages were then generated:
> gdalprogram.c:(.text+0xc): undefined reference to `GDALAllRegister'
> gdalprogram.c:(.text+0x28): undefined reference to `GDALOpen'

[CUT]

> 
> 
> Any help to resolve this is appreciated.
> 
> Thanks,
> 
> Alassane

You should also link the GDAL library. Assuming you have gdal 1.7
installed you should use something like

$ gcc -o test gdalprogram.c -I /usr/include/gdal -lgdal1.7.0


best regards

-- 
Antonio Valentino


More information about the Ubuntu mailing list