[gdal-dev] ArcSDE OGR Driver

Frank Warmerdam warmerdam at pobox.com
Mon Dec 10 17:07:05 EST 2007


Simon Perkins wrote:
> Hi,
> 
> I'm having problems compiling GDAL/OGR with ArcSDE read support. I have
> the ArcSDE 9.2 SDK installed, and have edited the nmake.opt file to
> point to the appropriate places. Compile seems to work OK, but I end up
> with an OGR that doesn't seem to have ArcSDE support enabled. For
> instance, ogrinfo --formats doesn't list ArcSDE as a supported format.
> Also when tracing through the ogrinfo executable in Visual Studio, in
> the body of OGRRegisterAll(), the line which calls RegisterOGRSDE() is
> never reached, seeming to indicate that the SDE_ENABLED compile time
> define is not set.
> 
> I'm using Visual Studio 2005 on Windows Vista with the latest GDAL from
> Subversion.
> 
> Here are the relevant lines from nmake.opt.
> 
> SDE_ENABLED = YES
> SDE_VERSION=92
> SDE_PLUGIN = NO
> SDE_SDK = C:\arcgis\arcsde
> SDE_INC = $(SDE_SDK)\include
> SDE_LIB = $(SDE_SDK)\lib\pe.lib \
>          $(SDE_SDK)\lib\sde.lib $(SDE_SDK)\lib\sg.lib
> 
> 
> I'm still investigating, but wondered if anyone had any ideas?

Sy,

This *looks* ok to me.  You may need to do an "nmake /f makefile.vc clean"
and then build again.  GDAL/OGR is generally not smart about what needs to
be rebuilt when include files or makefiles change.

Ah, I see the problem.  In gdal/ogr/ogrsf_frmts/generic/makefile.vc
we test:

!IFNDEF SDE_PLUGIN
SDEDEF = -DSDE_ENABLED
!ENDIF

So instead of testing the value of SDE_PLUGIN we just check if it is
defined, and assume that defined means yes.  You can presumably work around
this by commenting out the declaration.  I'll adjust the source for 1.5.0.

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



More information about the gdal-dev mailing list