OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Building OpenSceneGraph-3.3.4 with GDAL 2.0


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build]
View previous topic :: View next topic  
Author Message
cgsbob
Newbie


Joined: 01 Jan 2015
Posts: 3

PostPosted: Mon Jan 12, 2015 7:36 am    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

Hi All,

I'm trying to build from git and I get the following error messages:

Quote:
[ 82%] Building CXX object src/osgPlugins/ogr/CMakeFiles/osgdb_ogr.dir/ReaderWriterOGR.o
/home/bob/dev/graphics/osg/src/osgPlugins/ogr/ReaderWriterOGR.cpp: In member function ‘virtual osgDB::ReaderWriter::ReadResult ReaderWriterOGR::readFile(const string&, const Options*) const’:
/home/bob/dev/graphics/osg/src/osgPlugins/ogr/ReaderWriterOGR.cpp:141:31: error: ‘Open’ is not a member of ‘OGRSFDriverRegistrar’
OGRDataSource* file = OGRSFDriverRegistrar::Open(fileName.c_str());


I did a "make -k" to see if there were any other errors, but everything else compiles fine. So, in the meantime, I'm back to an older version of GDAL and osg compiles. I have information from the GDAL devs on how to solve this problem, but I'm not able to post urls in this forum at this time.

Thank you!

Cheers,
Bob
Back to top
View user's profile Send private message
cgsbob
Newbie


Joined: 01 Jan 2015
Posts: 3

PostPosted: Mon Jan 12, 2015 6:32 pm    Post subject:
Reply with quote

Is there a bug tracker for osg? I've seen the trac openscenegraph website but the registration page seems to be broke.

Cheers,
Bob
Back to top
View user's profile Send private message
cgsbob
Newbie


Joined: 01 Jan 2015
Posts: 3

PostPosted: Wed Jan 14, 2015 7:15 am    Post subject:
Reply with quote

Hi,

This is information I got from the GDAL devs:
Quote:
<cgs_bob> hello all. I was trying to compile OpenSceneGraph-3.0.1 and got this error http://pastebin.com/raw.php?i=c1MAC1rQ . Is this related to api changes in GDAL 2.0? How do I fix it?
<EvenR> cgs_bob: yes. see http://svn.osgeo.org/gdal/trunk/gdal/MIGRATION_GUIDE.TXT
<cgs_bob> EvenR: thanks for the tip. I'll give it a try
<EvenR> using OGROpen(), and the C API, if you want it to be compabile with both GDAL 1.X and 2.X is probably the best solution
<EvenR> I guess this will bite a few people, but would have been awkward to let that as a left-over
<cgs_bob> I'll have to see what requires the least amount of work.
<cgs_bob> EvenR: OpenSceneGraph is a C++ library. How could I use the OGROpen(), and the C API to solve this compiler error?
<EvenR> this is described in http://gdal.org/ogr_apitut.html (or http://gdal.org/1.11/ogr/ogr_apitut.html if you want GDAL 1.X compatibilty as well)

The pastebin url refers to the error message in the first post.
Thank you!

Cheers,
Bob[/quote][/url]
Back to top
View user's profile Send private message
Jordi Torres
Guest





PostPosted: Wed Jan 14, 2015 9:04 am    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

Hi Bob, 

AFAIK There is not a bug tracker for OSG. The trac is not open for registration intentionally, it is out of date and it is up for backup/historical purposes only. 


Cheers. 


2015-01-12 19:32 GMT+01:00 Bob Moskovitz < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Is there a bug tracker for osg?  I've seen the trac openscenegraph website but the registration page seems to be broke.

Cheers,
Bob

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62304#62304





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Jordi Torres

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11190

PostPosted: Wed Jan 14, 2015 10:52 am    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

Hi Bob,

On 12 January 2015 at 18:32, Bob Moskovitz < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Is there a bug tracker for osg?  I've seen the trac openscenegraph website but the registration page seems to be broke.


I've deliberately avoiding bug trackers so that issues are reported osg-users so that many eye balls can respond/chip in with their suggestions.


Cheers,
Robert.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11190

PostPosted: Wed Jan 14, 2015 10:55 am    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

Hi Bob,


How far have you got with porting? BTW, could you try working on at least OSG-3.2.1, or preferably the svn/trunk so that you are testing against the latest OSG - this is also where any fixes you have will be checked in.


Retaining backwards compatibility with compiling against GDAL-1.x is important as lot of others users will have this on their systems.

Cheers,
Robert.



On 14 January 2015 at 07:16, Bob Moskovitz < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

This is information I got from the GDAL devs:

Quote:
<cgs_bob>     hello all.  I was trying to compile OpenSceneGraph-3.0.1 and got this error http://pastebin.com/raw.php?i=c1MAC1rQ . Is this related to api changes in GDAL 2.0?  How do I fix it?
<EvenR>       cgs_bob: yes. see http://svn.osgeo.org/gdal/trunk/gdal/MIGRATION_GUIDE.TXT
<cgs_bob>     EvenR: thanks for the tip.  I'll give it  a try
<EvenR>       using OGROpen(), and the C API, if you want it to be compabile with both GDAL 1.X and 2.X is probably the best solution
<EvenR>       I guess this will bite a few people, but would have been awkward to let that as a left-over
<cgs_bob>     I'll have to see what requires the least amount of work.
<cgs_bob>     EvenR: OpenSceneGraph is a C++ library.  How could I use the  OGROpen(), and the C API to solve this compiler error?
<EvenR>       this is described in http://gdal.org/ogr_apitut.html (or http://gdal.org/1.11/ogr/ogr_apitut.html if you want GDAL 1.X compatibilty as well)


The pastebin url refers to the error message in the first post.
Thank you!

Cheers,
Bob
[/url]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62313#62313





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[/quote]

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
minghia
Appreciator


Joined: 12 Dec 2011
Posts: 106
Location: Sydney, Australia

PostPosted: Thu Jun 25, 2015 7:01 am    Post subject:
Reply with quote

Hi,
I get a similar problem with GDAL 2.0 and the OpenSceneGraph 3.2.1
Code:

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

Code:

/************************************************************************/
/*                         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
Code:
ogr_api.h
have extra parameters
Code:
OGRDataSourceH CPL_DLL OGROpen( const char *, int, OGRSFDriverH * ) CPL_WARN_UNUSED_RESULT;


to what is called from ReaderWriterOGR.cpp.
...


Thank you!

Cheers,
Tony
Back to top
View user's profile Send private message
minghia
Appreciator


Joined: 12 Dec 2011
Posts: 106
Location: Sydney, Australia

PostPosted: Thu Jun 25, 2015 8:01 am    Post subject:
Reply with quote

Hi,

I have this patch so that it compiles but I don't have a ogr source file to test it against. But this allows OpenSceneGraph 3.2.1 to compile.

...


Thank you!

Cheers,
Tony
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11190

PostPosted: Fri Jun 26, 2015 9:51 am    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

 Hi Tony,


You suggested changed breaks the build for GDAL<2.0.


I have changed the ReaderWriterOGR.cpp to contain both the original code blocks and the ones modified by you with a GDAL_VERSION_MAJOR<2 check.  Attached is the modified file.  Could you try this out, if it works fine I'll check it into svn/trunk and the OSG-3.2 branch.


Robert.


On 25 June 2015 at 09:01, Tony Vasile < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

I have this patch so that it compiles but I don't have a ogr source file to test it against. But this allows OpenSceneGraph 3.2.1 to compile.

...


Thank you!

Cheers,
Tony

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64190#64190




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
minghia
Appreciator


Joined: 12 Dec 2011
Posts: 106
Location: Sydney, Australia

PostPosted: Fri Jun 26, 2015 11:17 am    Post subject:
Reply with quote

Hi Robert,
Am I going blind I can see your attachment with your modified patch?

...


Thank you!

Cheers,
Tony
Back to top
View user's profile Send private message
minghia
Appreciator


Joined: 12 Dec 2011
Posts: 106
Location: Sydney, Australia

PostPosted: Fri Jun 26, 2015 12:39 pm    Post subject:
Reply with quote

Hi Robert

Not sure if you came up with this but since I couldn't see your version of the patch I recreated it.

...


Thank you!

Cheers,
Tony
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11190

PostPosted: Fri Jun 26, 2015 12:43 pm    Post subject:
Building OpenSceneGraph-3.3.4 with GDAL 2.0
Reply with quote

On 26 June 2015 at 13:39, Tony Vasile < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Not sure if you came up with this but since I couldn't see your version of the patch I recreated it.


Oppps. Must have missed attaching the file...


You file looks roughly the same.  In my change I cleaned up one of the commented out lines in your code.


Robert.

 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Build system [build] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts OpenSceneGraph static linking for And... tanshihaj Build system [build] 1 Thu Sep 21, 2017 12:56 pm View latest post
No new posts OpenSceneGraph-3.4.1 released! robertosfield General 3 Mon Aug 28, 2017 5:39 pm View latest post
No new posts OpenSceneGraph-3.4.1-rc3 tagged robertosfield General 2 Fri Aug 25, 2017 3:27 pm View latest post
No new posts OpenSceneGraph-3.4.1-rc2 tagged robertosfield General 3 Tue Aug 22, 2017 11:25 am View latest post
No new posts OpenSceneGraph static linking for And... tanshihaj Build system [build] 1 Sun Aug 13, 2017 10:09 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP