[Gdal-dev] linking proj4

Frank Warmerdam warmerdam at pobox.com
Thu Jun 1 15:32:12 EDT 2006

Chris Calloway wrote:
> I've done *some* looking around, and figure I'm at the point where I 
> should ask...
> Considering the gdal configure feature:
> --with-static-proj4
> described as:
> "Compile with PROJ.4 statically"
> Does this mean proj is automatically dynamically linked (if present in 
> the library path or by ld.so.conf, etc.) by GDAL, or that the only 
> possible linking of proj by GDAL is static?


By default GDAL does not reference PROJ.4 at link time.  But at runtime
it will use dlopen() or LoadLibrary() to try and load the PROJ.4 DLL.
If found additional reprojection.  The --with-static-proj4 flag changes
things so that PROJ.4 is linked in at link time.  Despite the name, it
could actually be linking in the DLL or static version of PROJ.

I implemented this rather esoteric approach to avoid making GDAL directly
dependent on PROJ.  It would just use it at runtime if it was available.
I'm not so sure in retrospect that it was a good idea.

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    | President OSGF, http://osgeo.org

More information about the Gdal-dev mailing list