[Ubuntu] GDAL compilation

Alassane Toure atourej at gmail.com
Thu Jan 5 15:23:20 EST 2012


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'
gdalprogram.c:(.text+0x38): undefined reference to `GDALGetDatasetDriver'
gdalprogram.c:(.text+0x48): undefined reference to `GDALGetDriverLongName'
gdalprogram.c:(.text+0x56): undefined reference to `GDALGetDriverShortName'
gdalprogram.c:(.text+0x77): undefined reference to `GDALGetRasterCount'
gdalprogram.c:(.text+0x85): undefined reference to `GDALGetRasterYSize'
gdalprogram.c:(.text+0x93): undefined reference to `GDALGetRasterXSize'
gdalprogram.c:(.text+0xb8): undefined reference to `GDALGetProjectionRef'
gdalprogram.c:(.text+0xc8): undefined reference to `GDALGetProjectionRef'
gdalprogram.c:(.text+0xed): undefined reference to `GDALGetGeoTransform'
gdalprogram.c:(.text+0x143): undefined reference to `GDALGetRasterBand'
gdalprogram.c:(.text+0x163): undefined reference to `GDALGetBlockSize'
gdalprogram.c:(.text+0x16f): undefined reference to 
`GDALGetRasterColorInterpr


Any help to resolve this is appreciated.

Thanks,

Alassane


More information about the Ubuntu mailing list