VTK6.3.0 error: no override found for 'vtkPolyDataMapper'

2023-05-16


1 开发环境

    计算机系统: Win7

    Qt版本: 5.4.0

    Qt Creator版本: 3.0.1

    VTK版本:  6.3.0

    编译器: VS2013


2 解决方法1

    根据参考资料[1]的说明,在源程序中添加头文件

[cpp] view plain copy
  1. #include <vtkAutoInit.h>  
    然后在main函数的开始处添加
[cpp] view plain copy
  1. VTK_MODULE_INIT(vtkRenderingOpenGL);  
    重新编译运行,第2中章的问题解决!然是又出现了以下问题:


    在main函数中继续添加

[cpp] view plain copy
  1. VTK_MODULE_INIT(vtkInteractionStyle);  
    结果问题都解决!

3 解决方法2

    在包含VTK的所有头文件前,先定义一下代码段

[cpp] view plain copy
  1. #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)  
  2. #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)  
    这样,同样可以解决第2章和第3章出现的问题。********************************************************************************************************************************************************************

******************************************************************************************************************************************************************


If you build your project with CMake, and you use the standard find_package(VTK) and include(${VTK_USE_FILE}) then this problem should not occur. (Because the defines will be automatically added for you by virtue of the include(${VTK_USE_FILE})...)


The factory methods now require "auto-initialization" depending on what modules are enabled at VTK configure time. If you are enabling all modules, and building your project without using CMake, you will need some defines in your project in order to make the factories work properly.


On September 10, 2013 a new macro was added to make this process a little simpler for projects that just want to initialize modules, where ordering ceases to be important but you must still build a source file into your application that has something along with following (with one entry for each module that should be initialized).


 #include <vtkAutoInit.h>
 VTK_MODULE_INIT(vtkRenderingOpenGL);
  

This will initialize the vtkRenderingOpenGL object factories, and should be done for each module. If you are using an older version of VTK (6.0 or master from before the date above) than you can try including this snippet in all your code that includes VTK usage, BEFORE including ANY VTK header files:


 #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
 #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)
  

See these references (and follow the mailing list threads to their conclusions) for more info:

  • http://www.vtk.org/pipermail/vtkusers/2013-April/128255.html
  • https://github.com/Kitware/VTK/commit/9385718b82e6af83b7e7dcc90a937419edc6892b
  • http://www.vtk.org/pipermail/vtkusers/2013-March/127811.html

I have also had the NULL pointer; surely the code should not compile and just dump a NULL pointer as a result of a call to


   theMapper = vtkPolyDataMapper::New();
  

However after setting the above options (in Windows VStudio 2008 v9 "Property Pages->Preprocessor definitions" for the program I am linking) I get a message from my compiler that some (20) functions were not found. The user at ref [1] seems to have hundreds of missing links.

"2>vtkSDIView.obj : error LNK2001: unresolved external symbol "void __cdecl vtkInteractionStyle_AutoInit_Construct(void)" (?vtkInteractionStyle_AutoInit_Construct@@YAXXZ) 2>vtkSDI.cpp.obj : error LNK2001: unresolved external symbol "void __cdecl vtkInteractionStyle_AutoInit_Destruct(void)"(?vtkInteractionStyle_AutoInit_Destruct@@YAXXZ)"

After linking all the libraries found in the example code (eg the Cone example) these link errors go away. This required adding several tens of new libraries that I had not needed to link for version 5.8 which is slightly annoying. The preprocessor definitions I mention above can also be copied from the Cone example.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VTK6.3.0 error: no override found for 'vtkPolyDataMapper' 的相关文章

随机推荐

  • stm32中库函数和hal库的区别

    今天在b站看一个关于嵌入式的视频 xff0c 讲述使用stm32cube软件的 了解这些的小伙伴们应该知道STM32CubeMX 是意法半导体推出的图形化配置工具 xff0c 通过傻瓜化的操作便能实现相关配置 xff0c 最终能够生成C语言
  • python+selenium自动化能打开火狐浏览器但是打不开网址

    python 43 selenium 执行自动化脚本时能打开火狐浏览器而打不开网址时 提示 xff1a Unsupported Marionette protocol version 2 required 3 是由版本不兼容导致的 我安装的
  • 使用docker运行gitlab服务

    之前 xff0c 在服务器上直接安装配置过gitlab xff0c 感觉需要配置安装的东西还是挺多的 xff1a git xff0c redis xff0c postgresql xff0c nginx等 这么多服务一起 xff0c 备份和
  • Kubernetes运维之使用Prometheus全方位监控K8S (概念篇)

    目录 xff1a Prometheus架构 K8S监控指标及实现思路 在K8S平台部署Prometheus 基于K8S服务发现的配置解析 在K8S平台部署Grafana 监控K8S集群中Pod Node 资源对象 使用Grafana可视化展
  • Grafana 告警配置、告警通道及告警内容的安装和配置

    本文主要介绍grafana的告警是如何配置的 xff0c 以及在触发告警时通过邮件和企业微信消息将告警通知给用户 xff0c 最后介绍了如何在告警内容中添加告警时刻的panel图片 告警配置 grafana的告警触发以panel为基础 xf
  • 【面经】momenta 二面

    二面好像主要针对C 43 43 研发来的 所以就基本上问的算法题 面试官小哥哥超nice的 xff0c 整个过程都很耐心 xff0c 最后还细心的讲解了全部的题目 这也太好了8 map的底层实现 xff0c 红黑树 C 43 43 11的了
  • stm32串口通信

    stm32串口通信 基于寄存器与基于固件库编写的差异 使用固件库 xff0c 目前比较多的例程是使用固件库编写的 固件库编写方式 xff0c 特点是简单易于理解 xff0c 资料多 新手适合用这种方式入门 使用寄存器 xff0c 想要深入理
  • markdown和reStructuredText语法简单比较

    PyCharm默认的代码注释就是reStructuredText风格的 加之之前学习 实验设计 这门课的时候 用过readthedocs 43 sphinx写过文档 其默认的格式就是reStructuredText风格的 所以比较好奇 当时
  • python之BeautifulSoup之二 带属性值的抓取(find_all('tag', attrs={'class':'value'})

    系统 xff1a Windows python 2 7 11 利用BeautifulSoup库抓取页面的一些标签TAG值 再抓取一些特定属性的值 示例标签 xff1a lt cc gt lt div id 61 34 post conten
  • 关于租用香港服务器疑问解答

    关于租用香港服务器许多用户还有很多疑问 xff0c 那么下面由专门做海外服务器租用 托管的RAKsmart机房进行疑问解答 香港服务器器租用疑问如下 xff1a 问题一 xff1a 租用香港服务器违法吗 xff1f 租用香港服务器不违法 x
  • 三维重建方法--激光or视觉

    导读 xff1a 激光雷达则是无人驾驶和扫地机器人等领域的核心一环 那么为什么出现多种方案呢 xff1f 它们到底有什么差异 xff1f 看似很酷炫的技术 xff0c 实际上并没有外界想得那么高大上 Realsense之所以能够识别物体的深
  • 虚拟机中ubuntu的中文输入法安装

    1 安装中文语言包 xff0c 在终端里面运行 这个不是很熟悉 xff0c 下面还有些命令 xff0c 但是我只运行了这几个 xff0c 后面就可以顺利安装了 原理不太清楚 sudo apt get install scim sudo ap
  • 1、Ubuntu下安装软件报错

    今天在ubuntu下安装任何软件都提示以下错误 xff1a ideallic 64 ubuntu sudo apt get install git sudo password for ideallic Reading package lis
  • 查看安装的ROS版本号

    1 先在终端输入roscore 2 打开新终端 xff0c 再输入 xff0c rosparam list 3 再输入rosparam get rosdistro就能得到版本
  • [fake_turtlebo.launch] is neither a launch file in package [rbx1_bringup] nor is [rbx1_bringup] ...

    1 问题描述如下 xff1a 2 执行如下命令 export grep ROS 发现ROS PACKAGE PATH不包含本包的路径 3 执行以下命令 cd catkin ws catkin make source devel setup
  • 用C++实现一个简单的PID控制器

    用C 43 43 实现一个简单的PID控制器 先上代码 xff0c 原理后面再补充 span class token macro property span class token directive keyword include spa
  • VTK User’s Guide -11th edition 第01章-欢迎学习VTK

    本节对应原书中的第3页至第7页 欢迎开启VTK之旅 VTK用户指南 VTK是一个开源的 面向对象的计算机图形 可视化和图像处理的软件系统 虽然VTK比较庞大 复杂 xff0c 但是当你了解了它基本的面向对象的设计和实现的方法以后 xff0c
  • VTK User’s Guide -11th edition 第03章-VTK系统概述(3)

    本节对应原书中的第29页至第39页 3 2创建VTK应用程序 本章内容包括利用Tcl xff0c C 43 43 xff0c Java和Python四种语言开发VTK应用程序的基本知识 阅读完引言后 xff0c 你应该了解用你擅长的语言进行
  • VTK中经常使用的头文件和LIB文件名称

    1 常用头文件 cpp view plain copy define vtkRenderingCore AUTOINIT 4 vtkInteractionStyle vtkRenderingFreeType vtkRenderingFree
  • VTK6.3.0 error: no override found for 'vtkPolyDataMapper'

    1 开发环境 计算机系统 Win7 Qt版本 5 4 0 Qt Creator版本 3 0 1 VTK版本 6 3 0 编译器 VS2013 2 解决方法1 根据参考资料 1 的说明 xff0c 在源程序中添加头文件 cpp view pl