2011-06-19 3 views
1

私はvtkの初心者です。私はvtkChartsライブラリを使いたいと思います。 LinuxとWindowsの両方で、私はvtkをコンパイルして、ほとんどの例を扱うことができました。私はコンパイルすると、Visual Studioで、それはいくつかのリンクエラーが発生します、vtkChartsライブラリはVisual StudioやGCCコンパイラでは動作しません - なぜですか?

Line plot example

だけ面倒な例としては、リンク内の一つとして、チャートライブラリを含めたものを、ARRE。セグメントは以下の通りです。私は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

私はそれがどういう意味か分かりません。 –

関連する問題