2011-06-19 112 views
1

我是vtk的新手,我想使用vtkCharts庫。在Linux和Windows中,我編譯了vtk並設法使用大部分示例。vtkCharts庫不適用於Visual Studio,也不適用於GCC編譯器 - 爲什麼?

唯一麻煩的例子皆爲那些包括圖表庫,比如一個在鏈接:

Line plot example

當我編譯,在Visual Studio也提供了一些鏈接錯誤。分段在下面。我沒有忘記包含vtkCharts庫。

1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "protected: virtual __thiscall vtkRenderView::~vtkRenderView(void)" ([email protected]@[email protected]) referenced in function "protected: virtual __thiscall vtkContextView::~vtkContextView(void)" ([email protected]@[email protected]) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "public: virtual void __thiscall vtkRenderView::SetDisplayHoverText(bool)" ([email protected]@@[email protected]) referenced in function "protected: __thiscall vtkContextView::vtkContextView(void)" ([email protected]@[email protected]) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "protected: __thiscall vtkRenderView::vtkRenderView(void)" ([email protected]@[email protected]) referenced in function "protected: __thiscall vtkContextView::vtkContextView(void)" ([email protected]@[email protected]) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall vtkView::Update(void)" ([email protected]@@UAEXXZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall vtkRenderView::ApplyViewTheme(class vtkViewTheme *)" ([email protected]@@[email protected]@@Z) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "protected: virtual void __thiscall vtkRenderView::ProcessEvents(class vtkObject *,unsigned long,void *)" ([email protected]@@[email protected]@[email protected])

代碼::塊,使用GCC,它提供了象這樣的錯誤:

./VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|38|error: expected class-name before ‘{’ token| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: ‘vtkContextItem’ does not name a type| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: ‘vtkContextItem’ has not been declared| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: invalid static_cast from type ‘vtkObjectBase*’ to type ‘vtkChart*’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||In member function ‘virtual vtkObjectBase* vtkChart::NewInstanceInternal() const’:| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: ‘New’ is not a member of ‘vtkChart’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||In member function ‘virtual vtkAnnotationLink* vtkChart::GetAnnotationLink()’:| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: ‘class vtkChart’ has no member named ‘GetDebug’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||In member function ‘virtual void vtkChart::SetGeometry(int, int)’:| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: ‘class vtkChart’ has no member named ‘GetDebug’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: ‘class vtkChart’ has no member named ‘Modified’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||In member function ‘virtual int* vtkChart::GetGeometry()’:| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: ‘class vtkChart’ has no member named ‘GetDebug’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: ‘class vtkChart’ has no member named ‘GetClassName’| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||In member function ‘virtual void vtkChart::GetGeometry(int&, int&)’:| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: ‘class vtkChart’ has no member named ‘GetDebug’|

我用了兩個平臺VTK 5-6。我不知道爲什麼會出現這個錯誤的原因。

謝謝。

回答

1

I didn't forget to include the vtkCharts library.

然後你可能忘記了包含vtkHybrid庫。注意cmake文件中的最後一行。

+0

不,它也包括在內。但我注意到我沒有用例子構建vtk。圖表庫是否僅通過示例完成? –

+0

我不知道這意味着什麼。 –

相關問題