[osg-users] [build] Building OpenSceneGraph-3.3.4 with GDAL 2.0

Tony Vasile minghia at gmail.com
Thu Jun 25 00:01:27 PDT 2015

I get a similar problem with GDAL 2.0 and the OpenSceneGraph 3.2.1


home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp: In member function ‘virtual osgDB::ReaderWriter::ReadResult ReaderWriterOGR::readFile(const std::string&, const osgDB::ReaderWriter::Options*) const’:
/home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp:137: warning: ‘static OGRSFDriverRegistrar* OGRSFDriverRegistrar::GetRegistrar()’ is deprecated (declared at /usr/local/include/ogrsf_frmts.h:320)
/home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp:137: warning: ‘int OGRSFDriverRegistrar::GetDriverCount()’ is deprecated (declared at /usr/local/include/ogrsf_frmts.h:324)
/home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp:141: error: ‘Open’ is not a member of ‘OGRSFDriverRegistrar’
/home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp:161: warning: ‘virtual const char* OGRDataSource::GetName()’ is deprecated (declared at /usr/local/include/ogrsf_frmts.h:243)
/home/avasile/src/OpenSceneGraph-3.2.1/src/osgPlugins/ogr/ReaderWriterOGR.cpp:165: warning: ‘static void OGRDataSource::DestroyDataSource(OGRDataSource*)’ is deprecated (declared at /usr/local/include/ogrsf_frmts.h:245)

It seems that the GDAL API In 2.0 has changed so the code no longer compiles. If one looks at the appropriate OGR header file there is a comment to indicate that OGRSFDriverRegistrar is also deprecated and should be replace by 


/*                         OGRSFDriverRegistrar                         */

 * LEGACY class. Use GDALDriverManager in your new code ! This class may be
 * removed in a later release.
 * Singleton manager for OGRSFDriver instances that will be used to try
 * and open datasources.  Normally the registrar is populated with 
 * standard drivers using the OGRRegisterAll() function and does not need
 * to be directly accessed.  The driver registrar and all registered drivers
 * may be cleaned up on shutdown using OGRCleanupAll().
 * @deprecated 

The only open calls in 

 have  extra parameters 
OGRDataSourceH CPL_DLL OGROpen( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT;

to what is called from ReaderWriterOGR.cpp.

Thank you!


Read this topic online here:

More information about the osg-users mailing list