VTK/CommonProblems

From KitwarePublic
< VTK
Revision as of 16:49, 7 September 2010 by Daviddoria (talk | contribs) (Created page with "* error: forward declaration of ‘struct vtkXYZ’ '''Problem''' <source lang="cpp"> actor->GetProperty()->SetColor(0, 1, 0); </source> error: forward declaration of ‘struc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
  • error: forward declaration of ‘struct vtkXYZ’

Problem

<source lang="cpp"> actor->GetProperty()->SetColor(0, 1, 0); </source>

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:

<source lang="cpp">

  1. include <vtkProperty.h>

</source>