ros-visualization/rviz

Undefined symbols after updating from 1.14.20 / const char* slots not accepted anymore

Closed this issue · 2 comments

After updating from 1.14.20 to 1.14.23 version, there is an interface incompatibility. It seem about rviz::EditableEnumProperty. could it be rollback?

[ERROR] [1715910267.480759600]: PluginlibFactory: The plugin for class 'rviz_plugin/ObjectArray' failed to load.  Error: Failed to load library /home/rviz_plugin/lib/librviz_plugin.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/rviz_plugin/lib//librviz_plugin.so: undefined symbol: _ZN4rviz20EditableEnumPropertyC1ERK7QStringS3_S3_PNS_8PropertyEPKcP7QObject)

Your environment

  • OS Version: e.g. Ubuntu 20.04
  • ROS Distro: [Noetic]
  • RViz, Qt, OGRE, OpenGl version as printed by rviz:

The missing symbol corresponds to the following constructor:

EditableEnumProperty(const QString& name = QString(),
const QString& default_value = QString(),
const QString& description = QString(),
Property* parent = nullptr,
const char* changed_slot = nullptr,
QObject* receiver = nullptr);

The Qt4-style signals have been replaced with modern Qt5-style signals. The constructor now looks as follows:

template <typename Func, typename R>
EditableEnumProperty(const QString& name,
const QString& default_value,
const QString& description,
Property* parent,
Func&& changed_slot,
const R* receiver)

You need to adapt the construction and pass your change_slot as a method pointer instead of a string:
EditableEnumProperty("name", "default", "description", parent, &MyClass::changed_slot, receiver);

Actually, it should suffice to recompile your plugin. I designed the new API to be backward-compatible. However, it is not ABI-compatible. So a recompile is required.