[gdal-dev] gdal_priv.h not found on ubuntu

Frank Warmerdam warmerdam at pobox.com
Thu Oct 30 11:13:47 EDT 2008


Matt Wilkie wrote:
>> Try:
>>
>> g++ -I/usr/include/gdal hillshade.cpp -lgdal -o hillshade
> 
> Thank you for the suggestion, still no good though:
> 
> :~/src/demtools$ g++ -I/usr/include/gdal hillshade.cpp -lgdal -o hillshade
> /usr/bin/ld: cannot find -lgdal
> collect2: ld returned 1 exit status
> 

Matt,

I don't know where the gdal library gets put, perhaps /usr/lib/gdal?

If so, it might help to do:

  g++ -I/usr/include/gdal hillshade.cpp -L/usr/lib/gdal -lgdal -o hillshade

You might also find the following works for you:

  g++ `gdal-config --cflags` hillshade.cpp -o hillshade `gdal-config --libs`

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