[osg-users] Segfault when using addChild on Group object

Andre Sanchez aurumknight.ak at gmail.com
Fri Apr 22 09:33:19 PDT 2016


Hi,

I'm trying to use OpenSceneGraph on my machine running.

When I run the following code, I always get a segfault on the line with addChild:


Code:

#include <osg/ref_ptr>
#include <osg/Node>
#include <osg/Group>
#include <osgViewer/Viewer>

int main(int argc, char** argv) {

  osg::ref_ptr<osg::Node> a = new osg::Node();
  osg::ref_ptr<osg::Group> b = new osg::Group();

  b->addChild(a.get());

  osgViewer::Viewer viewer;
  viewer.setSceneData(b);

  viewer.run();

  return 0;
}




Any ideas why this would happen? I'm on Ubuntu 14.04.4, and using the libopenscenegraph-dev package from apt-get.

Thanks,
Andre

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








More information about the osg-users mailing list