Opened 17 years ago

Last modified 17 years ago

#894 closed defect (fixed)

GML support fails to compile on GCC 3.4.4

Reported by: uschindler@… Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:


GDAL 1.2.6 compilation fails with:

ogrgmldatasource.cpp: In member function `OGRGMLLayer* 
ogrgmldatasource.cpp:323: error: cannot allocate an object of type `OGRGMLLayer'
ogrgmldatasource.cpp:323: error:   because the following virtual functions are 
/pangaea/gnu/include/ogrsf_frmts.h:200: error:  virtual OGRGeometry* 
/pangaea/gnu/include/ogrsf_frmts.h:201: error:  virtual void 
ogrgmldatasource.cpp: In member function `virtual OGRLayer* 
OGRGMLDataSource::CreateLayer(const char*, OGRSpatialReference*, 
OGRwkbGeometryType, char**)':
ogrgmldatasource.cpp:483: error: cannot allocate an object of type `OGRGMLLayer'
ogrgmldatasource.cpp:483: error:   since type `OGRGMLLayer' has abstract 
virtual functions
gmake[3]: *** [../o/ogrgmldatasource.o] Error 1
gmake[3]: Leaving directory `/pangaea/install/gdal-1.2.6/ogr/ogrsf_frmts/gml'
gmake[2]: *** [gml-target] Error 2
gmake[2]: Leaving directory `/pangaea/install/gdal-1.2.6/ogr/ogrsf_frmts'
gmake[1]: *** [sublibs] Error 2
gmake[1]: Leaving directory `/pangaea/install/gdal-1.2.6/ogr'
gmake: *** [ogr-target] Error 2

pangaeaw@pans1:~/install/gdal-1.2.6$ gcc --version
gcc (GCC) 3.4.4

Change History (2)

comment:1 by warmerdam, 17 years ago


I have been unable to reproduce this problem. 

In GDAL 1.2.6 there is a default iplementation of GetSpatialFilter()
on OGRLayer (in ogr/ogrsf_frmts/generic/ogrlayer.cpp) so I'm not
sure how that error could occur unless some older GDAL source or include
files are getting used.  Is it possible the include path is setup such that
an older version of the include files is getting picked up?  

/me looks at ogr/ogrsf_frmts/gml/GNUmakefile more carefully.

In fact, I can see how this could happen.  Try editing the GNUmakefile in
the gml directory and changing the CPPFLAGS reassignment line to look like


I have committed this line in CVS. 

I will close this bug now, in the hopes that this is the resolution, but feel
free to re-open it if I am wrong.

comment:2 by uschindler@…, 17 years ago

Now it works.
The older version of the include files is from our previous gdal-1.2.5 version 
which lies in the default include path (which is the same like 
$XERCES_INCLUDE): /pangaea/gnu/include in both cases.


Note: See TracTickets for help on using tickets.