[Mapserver-users] OGR not found

Frank Warmerdam warmerdam at pobox.com
Wed Mar 31 23:50:10 EST 2004


Joel Gwynn wrote:
> I'm going nuts here.  I'm trying to configure mapserver like so:
> ./configure --with-gd=/usr/local --with-proj --with-ogr --with-gdal
> --with-postgis --with-wfs --with-wms --with-php=/usr/
> 
> And things chug along nicely until this point:
> 
> checking for OGRRegisterAll in -lgdal.1.1... no
> configure: warning:         OGR not found in system libs... use
> --with-ogr=DIR.
> 
> and then later ...
> 
> configure: error: OGC WFS Server support cannot be enabled: missing OGR
> which is  required).
> 
> I've installed the GDAL package, which seems to include ogr.  How do I
> find out if ogr is installed, and if so, how do I tell the configure
> script, and if not, how do I install it?

Joel,

I gather you are working with MapServer 4.0.1?  I think it still has the
problem of looking explicitly for -lgdal.1.1, I think there will be a
MapServer 4.0.2 out at some point with this fix.  In the meantime you can
either use a "developer" snapshot of MapServer which does not have this
problem or following the following steps.

The good news is that the configure logic for MapServer doesn't really do
anything to magical.  For many purposes, you can just opt out of stuff on
the configure line and then doctor up the Makefile after the fact.

  o Configure without --with-ogr.  I used the following successfully
    just now with MapServer 4.0.1.

    ./configure --with-ogr --with-gd=/usr/local --with-wms --with-proj=/usr/local

  o Edit Makefile (with vi, or your text editor of choice)

  o Change the OGR section to look something like this:

# Optional OGR Support.  OGC Simple Feature inspired interface for vector
# formats.  See http://gdal.velocet.ca/projects/opengis/
OGR=	  -DUSE_OGR
OGR_LIB=  -lgdal
OGR_INC=
OGR_STATIC=


  o now save, and build normally.  Hopefully all will go well.

If there are problems finding the GDAL library, adjust OGR_LIB appropriately.
If the GDAL/OGR include files aren't in the default include path change
the OGR_INC to look something like:

OGR_INC=-I/usr/local/include

A similar strategy can be followed for GDAL.  That is set the GDAL= line to:

GDAL=-DUSE_GDAL

and if -lgdal isn't already in OGR_LIB you can put it in GDAL_LIB.

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 mapserver-users mailing list