DL VTK的菜鸟
2020-08-06 10:59
采纳率: 25%
浏览 824

VS2017调试vtk程序提示找不到vtkRenderingOpenGL2-8.2.dll,无法继续执行代码

小弟今天按照某篇博客的讲解创建了第一个vtk程序,前面都很顺利,但到最后遇到了下图中所示的问题,小弟是初学vtk的菜鸟,迟迟未能解决这个问题,恳请各位大佬帮帮忙,解决一下,非常感谢!下面是错误提示及代码图:
图片说明
图片说明

#include "vtkSmartPointer.h"
 #include "vtkRenderWindow.h"
 #include "vtkRenderer.h"
  #include "vtkRenderWindowInteractor.h"
  #include "vtkInteractorStyleTrackballCamera.h"
   #include "vtkCylinderSource.h"
    #include "vtkPolyDataMapper.h"
    #include "vtkActor.h"   
  int main()
    {
     vtkSmartPointer<vtkCylinderSource> cylinder = 
      vtkSmartPointer<vtkCylinderSource>::New();
     cylinder->SetHeight( 3.0 );
     cylinder->SetRadius( 1.0 );
     cylinder->SetResolution( 10 );

     vtkSmartPointer<vtkPolyDataMapper> cylinderMapper = 
      vtkSmartPointer<vtkPolyDataMapper>::New();
     cylinderMapper->SetInputConnection( cylinder->GetOutputPort() );
        vtkSmartPointer<vtkActor> cylinderActor = 
     vtkSmartPointer<vtkActor>::New();
    cylinderActor->SetMapper( cylinderMapper );

    vtkSmartPointer<vtkRenderer> renderer = 
       vtkSmartPointer<vtkRenderer>::New();
    renderer->AddActor( cylinderActor );
     renderer->SetBackground( 0.1, 0.2, 0.4 );

     vtkSmartPointer<vtkRenderWindow> renWin = 
       vtkSmartPointer<vtkRenderWindow>::New();
     renWin->AddRenderer( renderer );
     renWin->SetSize( 300, 300 );

     vtkSmartPointer<vtkRenderWindowInteractor> iren = 
       vtkSmartPointer<vtkRenderWindowInteractor>::New();
     iren->SetRenderWindow(renWin);

     vtkSmartPointer<vtkInteractorStyleTrackballCamera> style = 
      vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();
     iren->SetInteractorStyle(style);

     iren->Initialize();
     iren->Start();

    return 0;
    }
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • threenewbee 2020-08-06 16:07
    已采纳
    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • qq_34729374 2020-11-07 16:31

    还附带技能

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题