VTK/CommonProblems

From KitwarePublic

< VTK
Jump to: navigation, search
  • error: forward declaration of ‘struct vtkXYZ’

Problem

actor->GetProperty()->SetColor(0, 1, 0);

error: forward declaration of ‘struct vtkProperty’

Explanation The GetProperty() function returns a vtkProperty object. Even though you didn't need to reference it explicitly, the compiler still needs to know what it is!

Solution This is solved by simply including vtkProperty.h:

#include <vtkProperty.h>
Personal tools