ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unresolved symbol OgreVector3::ZERO in rviz tool plugin

asked 2021-03-18 12:14:10 -0500

staskikot gravatar image

updated 2021-03-19 07:36:09 -0500

I'm learning how to create custom tool plugins for rviz by following the "Plant Flag" tutorial (https://github.com/ros-visualization/...) in ROS2 FOXY.

I introduced many changes, in particular, I replaced

namespace Ogre {
class SceneNode;
class Vector3;
}

with

 #include <OgrePrerequisites.h>

But when I load the plugin into rviz, i keep running into the following error message:

LoadLibrary error: /rep/ros2/install/rviz_plugin_tutorials/lib/librviz_plugin_tutorials.so:      
undefined symbol: _ZN4Ogre7Vector34ZEROE

I'm using the version of Ogre provided with the rviz_ogre_vendor package and I'm attaching it by writing

find_package(rviz_ogre_vendor REQUIRED)

in CMakeLists.txt. I checked that the include directory for OGRE resolves correctly in cmake, however I am unsure about libraries for which there are relative rather than absolute paths:

OgreHLMSOgreMeshLodGeneratorOgreOverlayOgrePagingOgrePropertyOgreRTShaderSystemOgreTerrainOgreVolumeOgreMainPlugin_BSPSceneManagerPlugin_OctreeSceneManagerPlugin_PCZSceneManagerPlugin_ParticleFXRenderSystem_GLRenderSystem_GL3PlusCodec_STBI

but you don't need to link OgreVector, do you ? (OgreVector looks to me a template library, ZERO is declared there as static const and I don't have any occurances of ZERO in my project).

Actually i used to have two copies of OGRE in my machine, one in /usr/include and /usr/share (without libraries) and the second inside rviz_ogre_vendor which were in conflict, so I removed the first one.

Can anyone help me to solve this problem ?

EDITED: I added to CMakeLists.txt the following lines:

target_link_libraries(rviz_plugin_tutorials
  PUBLIC
  Qt5::Widgets
  rviz_ogre_vendor::OgreMain
  rviz_ogre_vendor::OgreOverlay
)

and

ament_export_dependencies(
  Qt5
  rviz_common
  rviz_ogre_vendor
)

It didn't help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-11 09:04:27 -0500

Helen gravatar image

Figured it out for my case: replacing the old ROS1-style headers like "OGRE/OgreSceneManager.h" and "OGRE/OgreSceneNode.h" with the ROS2-style "OgreSceneManager.h" and "OgreSceneNode.h" fixed this linking error for me. Hope this helps someone else!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-18 12:14:10 -0500

Seen: 196 times

Last updated: Oct 11 '21