[Gdal-dev] hello, a question of static link proj4

Frank Warmerdam warmerdam at pobox.com
Tue Oct 12 10:22:24 EDT 2004


perl.bj wrote:
> hello, How do you static link proj4? I want to static link gdal, what 
> should i do?

Perl.BJ,

If you use the GDAL configure option "--with-static-proj" you can
statically link PROJ.4 into the GDAL shared library instead of having it
uses dynamic loading to find the PROJ shared library at run time.  Now this
still will generally mean that the PROJ shared library is used, but it will
be done using normal shared library mechanisms rather than dynamic loading
(using dlopen() and dlsym()).  I am assuming you are interested in Linux/Unix
since you didn't specify.

You also state that you want to "static link gdal".  Do you mean that you
want to link gdal static libraries into your application?  This can be
pretty tricky, but in theory the "gdal-config --dep-libs" output plus
adding libgdal.a to your link should accomplish this.  This isn't something
that I often attempt.

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