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 

Osgearth with c++


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty]
View previous topic :: View next topic  
Author Message
ThaPear
Guest





PostPosted: Mon Aug 15, 2011 2:09 pm    Post subject:
Osgearth with c++
Reply with quote

Hey,

I'm trying to get osgEarth working with c++ and visual studio 2010.
I have followed all build instructions, built OSG and OSGEarth. Added all directories to path, including all depencies they both have.

When I navigate to the osgearth/tests directory using cmd.exe and type: osgviewer XXXXX.earth it works, the window opens and I get a nice earth.

However, when I try to use this line in my c++ code:
Code:
osg::ref_ptr< osg::Node > globe = osgDB::readNodeFile("data/graticule.earth");
I get the following error:
Code:
Warning: Could not find plugin to read objects from file "data/graticule.earth".


I moved graticule.earth to a folder named data inside my project's working directory.

I have tried placing the osgearth dlls in:
My osg/bin directory
My osg/bin/plugins directory
My project's working directory
A folder specified in my PATH environment variable

OSG works perfectly, I am able to load any of it's native filetypes.

Thanks,
ThaPear
Back to top
Jason Beverage
Guest





PostPosted: Mon Aug 15, 2011 4:17 pm    Post subject:
Osgearth with c++
Reply with quote

Hi ThaPear,

First, you need to make sure that all the dependencies and plugins are
in your path when you run your program (OSG, osgEarth, GDAL, etc). So
if you're trying to run from visual studio with the "run" button for
instance you need to either have your global path setup correctly or
copy all the required deps to your program's bin folder for it to
work.

It sounds like it's just not able to find the earth plugin. You can
debug this by setting your OSG_NOTIFY_LEVEL env var to DEBUG and
seeing where OSG is trying to find the DLLs.

Thanks!

Jason

On Mon, Aug 15, 2011 at 10:09 AM, Tha Pear <> wrote:
Quote:
Hey,

I'm trying to get osgEarth working with c++ and visual studio 2010.
I have followed all build instructions, built OSG and OSGEarth. Added all directories to path, including all depencies they both have.

When I navigate to the osgearth/tests directory using cmd.exe and type: osgviewer XXXXX.earth it works, the window opens and I get a nice earth.

However, when I try to use this line in my c++ code:

Code:
osg::ref_ptr< osg::Node > globe = osgDB::readNodeFile("data/graticule.earth");

I get the following error:
Code:
Warning: Could not find plugin to read objects from file "data/graticule.earth".



I moved graticule.earth to a folder named data inside my project's working directory.


Thanks,
ThaPear

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









------------------
Post generated by Mail2Forum
Back to top
ThaPear
Guest





PostPosted: Tue Aug 16, 2011 9:15 am    Post subject:
Reply with quote

Hey,

You were right, it was unable to find the correct dlls.
I found I had not yet built the debug dlls of osgearth and was trying to run my own application in debug. Causing it to search for those debug dlls, whilst only the release dlls were available.
It's working like a charm now.

Thanks for the help,
ThaPear
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty] 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 osgQt & osgEarth not working with... Db80 General 0 Thu May 16, 2019 2:15 pm View latest post
No new posts adding object models in osgEarth best... Db80 General 10 Tue Apr 30, 2019 6:12 pm View latest post
No new posts Air-Traffic Surveillance Display usin... eskay187 Announcement [ANN] 2 Wed Feb 13, 2019 7:07 am View latest post
No new posts Use PNG as texture for terrain in osg... Rodrigo General [3rdparty] 12 Mon Jan 07, 2019 5:13 pm View latest post
No new posts class osgEarth::Map has no member nam... Rodrigo General [3rdparty] 3 Wed Jan 02, 2019 4:39 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