暴走的餅乾 发表于 2017-8-4 12:31:17

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

前两天刚刚接触,费了力气才把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());
}
页: [1]
查看完整版本: 求助!osg在vs下运行时失败