ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
847 stars 463 forks source link

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

Closed tsukione closed 5 months ago

tsukione commented 6 months ago

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

rhaschke commented 6 months ago

The missing symbol corresponds to the following constructor: https://github.com/ros-visualization/rviz/blob/fd566b96d54f6f2f003291dd99563396ee5809e4/src/rviz/properties/editable_enum_property.h#L47-L52

The Qt4-style signals have been replaced with modern Qt5-style signals. The constructor now looks as follows: https://github.com/ros-visualization/rviz/blob/2db2c5394a4f1fcf5fecfb8d0952d4f913c04aee/src/rviz/properties/editable_enum_property.h#L52-L58

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);

rhaschke commented 6 months ago

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.