2017-02-27 17 views
1

누락 나는이 다음 코드 :vtkStandardNewMacro 오류 C4430을 제공합니다 : 타입 지정자

오류 C4430를 :

#include <vtkInteractorStyleTrackballCamera.h> 

class InteractorStyle : public vtkInteractorStyleTrackballCamera 
{ 
    public: 
     static InteractorStyle* New() {}; 
     vtkTypeMacro(InteractorStyle, vtkInteractorStyleTrackballCamera); 
     InteractorStyle() { 
      cout << "test"; 
     } 
     virtual void OnLeftButtonDown(); 

     virtual void OnKeyPress(); 

    private: 

}; 
vtkStandardNewMacro(InteractorStyle); //error here 

void InteractorStyle::OnLeftButtonDown() 
{ 
    std::cout << "test"; 
    // Forward events 
    vtkInteractorStyleTrackballCamera::OnLeftButtonDown(); 
}; 
void InteractorStyle::OnKeyPress() 
{ 
    // Get the keypress 
    vtkRenderWindowInteractor *rwi = this->Interactor; 
    std::string key = rwi->GetKeySym(); 

    // Output the key that was pressed 
    std::cout << "Pressed " << key << std::endl; 
    // Forward events 
    vtkInteractorStyleTrackballCamera::OnKeyPress(); 
}; 

나는 tutorial, 그것은 항상 vtkStandardNewMacro(InteractorStyle);에 대한 오류 아래에 나와 있습니다 따라 비록 실종 형태 지시자 - int가 가정된다. 참고 : C++은 을 지원하지 않습니다. default-int

해결 방법?

+0

이 오류는 일부 헤더가 누락되었다는 것을 의미 할 수 있습니다. – AMA

+1

@AMA 감사합니다. #include ' –

답변

4

추가 할 내용은 모두 #include <vtkObjectFactory.h>입니다. 튜토리얼에서는이 점을 명시 적으로 언급 한 적이 없으며 너무 나쁘다.