vtkCharts库既不适用于Visual Studio,也不适用于GCC编译器 - 为什么?
vtkCharts library doesn't work neither with Visual Studio nor with GCC compiler - Why?
我是vtk的新手,我想使用vtkCharts库。在Linux和Windows中,我编译了vtk并设法处理了大多数示例。
唯一麻烦的例子是包括图表库的例子,比如链接中的那个:
线图示例
当我编译时,在Visual Studio中它给出了一些链接错误。下面是一个片段。我没有忘记包含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:未解析的外部 符号"公共:虚拟虚空 __thiscall vtkRenderView::SetDisplayHoverText(bool(" (?SetDisplayHoverText@vtkRenderView@@UAEX_N@Z( 在函数"受保护: __thiscall vtkContextView::vtkContextView(void(" (??0vtkContextView@@IAE@XZ( 1>vtkCharts.lib(vtkContextView.obj( : 错误 LNK2019:未解析的外部 符号"受保护:__thiscall vtkRenderView::vtkRenderView(void(" (??0vtkRenderView@@IAE@XZ( 参考 在功能"受保护:__thiscall vtkContextView::vtkContextView(void(" (??0vtkContextView@@IAE@XZ( 1>vtkCharts.lib(vtkContextView.obj( : 错误 LNK2001:未解析的外部 符号"公共:虚拟虚空 __thiscall vtkView::Update(void(" (?Update@vtkView@@UAEXXZ( 1>vtkCharts.lib(vtkContextView.obj( : 错误 LNK2001:未解析的外部 符号"公共:虚拟虚空 __thiscall vtkRenderView::ApplyViewTheme(class vtkViewTheme *(" (?ApplyViewTheme@vtkRenderView@@UAEXPAVvtkViewTheme@@@Z( 1>vtkCharts.lib(vtkContextView.obj( : 错误 LNK2001:未解析的外部 符号"受保护:虚拟虚空 __thiscall vtkRenderView::P rocessEvents(class vtkObject *,无符号长,void *(" (?ProcessEvents@vtkRenderView@@MAEXPAVvtkObject@@KPAX@Z(
在 Code::Blocks 中,使用 GCC,它会给出如下错误:
./VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|38|error: "{"标记之前的预期类名| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: 'vtkContextItem' 不命名类型| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: "vtkContextItem"尚未 已声明| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: 来自类型的无效static_cast "vtkObjectBase*"键入"vtkChart*"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在 成员函数'虚拟 vtkObjectBase* vtkChart::NewInstanceInternal(( 康斯特':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|40|error: "新"不是"vtkChart"的成员| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在 成员函数'虚拟 vtk注释链接* vtkChart::GetAnnotationLink((':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: 'class vtkChart' 没有命名的成员 "获取调试"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|104|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在 成员函数"虚拟虚空" vtkChart::SetGeometry(int, int(':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: 'class vtkChart' 没有命名的成员 "获取调试"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|108|error: 'class vtkChart' 没有命名的成员 "修改"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在 成员函数 '虚拟 INT* vtkChart::GetGeometry((':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: 'class vtkChart' 没有命名的成员 "获取调试"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: 'class vtkChart' 没有命名的成员 "获取类名"| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h||在 成员函数"虚拟虚空" vtkChart::GetGeometry(int&, int&(':| ../VTK-build/VTK-5.6/VTK/Charts/vtkChart.h|109|error: 'class vtkChart' 没有命名的成员 "获取调试"|
我在两个平台上都使用 vtk 5-6。我想知道会发生此错误的原因。
谢谢。
我没有忘记包含vtkCharts库。
然后你可能忘了包括vtkHybrid库。 请注意 cmake 文件中的最后一行。
- OpenGL - 在 NDC 中计算位置适用于着色器,但不适用于'regular'程序
- 使用模板参数重载C++方法:如何使其适用于模板的子类?
- 如何修复我的最大公约数代码?它适用于除零和零以外的所有数字
- 选择排序C++(已修改)并非适用于所有情况
- 无法让"std::enable_if"适用于无作用域枚举
- 请找出我的代码中的错误,它在提交得到错误答案的同时仍然适用于我的所有测试用例
- 确定夏令时是否适用于特定日期
- 是否有一种 STL 算法可以最后找到,但它也适用于指针?
- 十进制到二进制的实现不能完全适用于我大学的检查器。问题或提示可能是什么
- 使用程序集嵌入数据时"Undefined reference"错误,使用适用于窗口的 mingw-w64 编译(COFF 而不是 ELF)
- 为什么 std::vector 适用于类定义中的不完整类型?
- 为什么哈希<常量字符*>适用于字符串而不是字符串变量?
- Lambda适用于最新的Visual Studio,但在其他地方不起作用
- 我该如何文档文档以使文档适用于类成员而不是匿名类型
- 计算 c# 中二进制文件符号的频率不起作用,但适用于等效的 c++ 代码
- 为什么 fstream.open(文件名) 适用于文字而不是生成的字符串?
- 模板重载和 SFINAE 仅适用于函数而不是类
- 为什么链接器不抱怨多个函数定义(仅适用于模板化函数)
- 我可以使用' == '来比较两个向量吗?我试过了,似乎工作正常。但我不知道它是否适用于更复杂的情况
- 延长临时的生命周期,适用于块范围的聚合,但不是通过"新";为什么?