1
votes

I'm a newbie to vtk and I want to use the vtkCharts library. In both Linux and Windows, I compiled vtk and managed to work with the most of the examples.

The only troublesome examples arre those including the chart library, such as the one in the link:

Line plot example

When I compile, in Visual Studio it gives some linking errors. A segment is below. I didn't forget to include the vtkCharts library.

1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "protected: virtual __thiscall vtkRenderView::~vtkRenderView(void)" (??1vtkRenderView@@MAE@XZ) referenced in function "protected: virtual __thiscall vtkContextView::~vtkContextView(void)" (??1vtkContextView@@MAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "public: virtual void __thiscall vtkRenderView::SetDisplayHoverText(bool)" (?SetDisplayHoverText@vtkRenderView@@UAEX_N@Z) referenced in function "protected: __thiscall vtkContextView::vtkContextView(void)" (??0vtkContextView@@IAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2019: unresolved external symbol "protected: __thiscall vtkRenderView::vtkRenderView(void)" (??0vtkRenderView@@IAE@XZ) referenced in function "protected: __thiscall vtkContextView::vtkContextView(void)" (??0vtkContextView@@IAE@XZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall vtkView::Update(void)" (?Update@vtkView@@UAEXXZ) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "public: virtual void __thiscall vtkRenderView::ApplyViewTheme(class vtkViewTheme *)" (?ApplyViewTheme@vtkRenderView@@UAEXPAVvtkViewTheme@@@Z) 1>vtkCharts.lib(vtkContextView.obj) : error LNK2001: unresolved external symbol "protected: virtual void __thiscall vtkRenderView::ProcessEvents(class vtkObject *,unsigned long,void *)" (?ProcessEvents@vtkRenderView@@MAEXPAVvtkObject@@KPAX@Z)

In Code::Blocks , using GCC, it gives errors like this:

./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’|

I'm using vtk 5-6 in both platforms. I wonder the reasons why this error might occur.

Thank you.

1

1 Answers

1
votes

I didn't forget to include the vtkCharts library.

Then you probably forgot to include the vtkHybrid library. Note the last line in the cmake file.