Which VTK version are you using? Maybe the example was not updated according to recent changes in VTK API.