ROS plugins vs. static linking

asked 2017-11-09 10:24:27 -0500

Wolf gravatar image

updated 2017-11-09 13:03:48 -0500

If running static linking in a ROS workspace by passing CMAKE_BUILD_SHARED_LIBS=ON it will only create static libs (.a files).

However, this seems prevent plugins from working. When trying to load them I receive the error:

Failed to load nodelet [....] of type [.....]: Could not find library corresponding to plugin ..... Make sure the plugin description XML file has the correct name of the library and that the library actually exists.

Should I add an explicit SHARED to each add_library if the respective library is eventually loaded by as a plugin in order to override the command line arg? Or are there other appropriate ways in this case?

edit retag flag offensive close merge delete

Comments

"static libs" and "is plugin lib not capable of handling static libs" is a bit of a strange question: dynamic libraries are exactly what is required for any sort of dynamic loading of object code.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-09 11:16:43 -0500 )edit

Ok, thank you, i guess adding an explicit shared to add libraries in Plugin pkgs is the Most senseful approach because creating static libs in these pkgs does Not make any sense then...

Wolf gravatar image Wolf  ( 2017-11-09 13:08:30 -0500 )edit