[gdal-dev] libgdal.o for including in a program

Frank Warmerdam warmerdam at pobox.com
Fri May 23 05:49:08 EDT 2008


On 5/22/08, Yann Chemin <yann.chemin at gmail.com> wrote:
> Hello,
>
> I am writing code for processing images using gdal library,
> and I do not have administrator access to the computers it is going to run
> on.
> Those computers do not have gdal in them (and run Linux OS)
>
> I would like to get libgdal inside my code at compilation time.
> something like:
>
> gcc -o ndvigdal main.o ndvi.o libgdal.o
>
> if that is possible, please kindly suggest ways to get on track.

Yann,

You should be able to link against the libgdal.a static library.
Try replacing -lgdal in the normal link with /path/to/libgdal.a.

Also be aware you then need to link against any libraries
GDAL requires.  Often the command "gdal-config --dep-libs"
will show you what you need at link time for this.

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