1

私はvtkの初心者で、vtkChartsライブラリを使用したいと思っています。LinuxとWindowsの両方で、私はvtkをコンパイルし、ほとんどの例で動作するように管理しました。

唯一の厄介な例は、リンクにあるようなチャートライブラリを含むものです。

折れ線グラフの例

コンパイルすると、VisualStudioでいくつかのリンクエラーが発生します。セグメントは以下のとおりです。vtkChartsライブラリを含めることを忘れませんでした。

1> vtkCharts.lib(vtkContextView.obj):エラーLNK2019:未解決の外部シンボル "保護:仮想__thiscall vtkRenderView ::〜vtkRenderView(void)"(?? 1vtkRenderView @@ MAE @ XZ)関数 "保護:仮想__thiscall vtkContextView ::〜vtkContextView(void) "(?? 1vtkContextView @@ MAE @ XZ)1> vtkCharts.lib(vtkContextView.obj):エラーLNK2019:未解決の外部シンボル" public:virtual void __thiscall vtkRenderView :: SetDisplayHoverText(bool) "( ?SetDisplayHoverText @ vtkRenderView @@ UAEX_N @ Z)関数 "protected:__thiscall vtkContextView :: vtkContextView(void)"(?? 0vtkContextView @@ IAE @ XZ)1> vtkCharts.lib(vtkContextView.obj):エラーLNK2019:未解決外部シンボル「保護:__ thiscall vtkRenderView :: vtkRenderView(void)」(?? 0vtkRenderView @@ IAE @ XZ)関数 "protected:__thiscall vtkContextView :: vtkContextView(void)"(?? 0vtkContextView @@ IAE @ XZ)1> vtkCharts.lib(vtkContextView.obj):エラーLNK2001:未解決で参照外部シンボル"public:virtual void __thiscall vtkView :: Update(void)"(?Update @ vtkView @@ UAEXXZ)1> vtkCharts.lib(vtkContextView.obj):エラーLNK2001:未解決の外部シンボル "public:virtual void __thiscall vtkRenderView: :ApplyViewTheme(class vtkViewTheme *) "(?ApplyViewTheme @ vtkRenderView @@ UAEXPAVvtkViewTheme @@@ Z)1> vtkCharts.lib(vtkContextView.obj):エラーLNK2001:未解決の外部シンボル"保護:仮想void __thiscall vtkRenderView :: ProcessEvents(class vtkObject *、unsigned long、void *) "(?ProcessEvents @ vtkRenderView @@ MAEXPAVvtkObject @@ KPAX @ Z)(?ProcessEvents @ vtkRenderView @@ MAEXPAVvtkObject @@ KPAX @ Z)

Code :: Blocksでは、GCCを使用すると、次のようなエラーが発生します。

./VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|38|エラー:「{」トークンの前にクラス名が必要です| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|エラー:'vtkContextItem'はタイプを指定しません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|エラー:「vtkContextItem」は宣言されていません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|エラー:タイプ「vtkObjectBase*」からタイプ「vtkChart*」へのstatic_castが無効です| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvtkObjectBase * vtkChart :: NewInstanceInternal()const':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|エラー:「新規」は「vtkChart」のメンバーではありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvtkAnnotationLink * vtkChart :: GetAnnotationLink()':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|エラー:'classvtkChart'には'GetDebug'という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvoid vtkChart :: SetGeometry(int、int)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|エラー:「classvtkChart」には「Modified」という名前のメンバーがありません| .. /VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualint * vtkChart :: GetGeometry()':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvoid vtkChart :: GetGeometry(int&、int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| 'classvtkChart'には'GetDebug'という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvoid vtkChart :: GetGeometry(int&、int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| 'classvtkChart'には'GetDebug'という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetClassName」という名前のメンバーがありません| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||メンバー関数内'virtualvoid vtkChart :: GetGeometry(int&、int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| GetGeometry(int&、int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません| GetGeometry(int&、int&)':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|エラー:「classvtkChart」には「GetDebug」という名前のメンバーがありません|

私は両方のプラットフォームでvtk5-6を使用しています。このエラーが発生する理由は何だろうか。

ありがとうございました。

4

1 に答える 1

1

vtkCharts ライブラリを含めることを忘れていませんでした。

次に、vtkHybrid ライブラリを含めるのを忘れた可能性があります。cmake ファイルの最後の行に注意してください。

于 2011-06-19T13:44:11.990 に答える