查看: 587|回复: 0

求助!osg在vs下运行时失败

[复制链接]

该用户从未签到

发表于 2017-8-4 12:31:17 | 显示全部楼层 |阅读模式
前两天刚刚接触,费了力气才把osg装好,然后..试了试示例代码,编译、链接都能通过,但是一运行就提示 应用程序无法正常启动(0xc000000d),请单击确定关闭应用程序。网上也没有说该怎么办的,我实在急得不得了。想请教一下各位前辈,出现这种情况到底该怎么办啊??我用的是Visual Studio 2010。
另外cmd下输入osg命令,比如osgviewerd cow.osg 出来的提示和在vs下面运行的一个样..会不会是我在安装的时候,编译源码编译了将近一个小时 几百个文件中有2个失败了 我当时不知道如何是好 所以就没去管 会不会是这个导致的?恳请各位前辈的帮助,谢谢!!
这是源代码
#include <osg/Group>
#include <osg/Geode>
#include <osgViewer/Viewer>
#include <osg/ShapeDrawable>

int main()
{
//Creating the viewer
osgViewer::Viewer viewer;

//Creating the root node
osg::ref_ptr<osg::Group> root (new osg::Group);

//The geode containing our shape
osg::ref_ptr<osg::Geode> myshapegeode (new osg::Geode);

//Our shape: a capsule, it could have been any other geometry (a box, plane, cylinder etc.)
osg::ref_ptr<osg::Capsule> myCapsule (new osg::Capsule(osg::Vec3f(),1,2));

//Our shape drawable
osg::ref_ptr<osg::ShapeDrawable> capsuledrawable (new osg::ShapeDrawable(myCapsule.get()));

myshapegeode->addDrawable(capsuledrawable.get());

root->addChild(myshapegeode.get());

viewer.setSceneData( root.get() );

return (viewer.run());
}
07820412b31bb05138f4d0d13c7adab448ede069.jpg
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表