ament / ament_cmake

Supporting CMake packages for working with ament
Apache License 2.0
98 stars 123 forks source link

packages that create shared libraries and msgs/srvs/actions with ROS IDL do not expose the shared libraries #320

Open Jconn opened 3 years ago

Jconn commented 3 years ago

I am writing a foxy package that uses some of the classes in https://github.com/SteveMacenski/spatio_temporal_voxel_layer, and links the shared library produced by spatio_temporal_voxel_layer in order to do that.

My package built fine, but when I run the navstack, and the navstack dynamically loads the shared library I produce, it complains about missing symbols from spatio_temporal_voxel_layer.

I couldn't see anything wrong with the CMake file for spatio_temporal_voxel_layer, but one thing different from the other packages I work with is spatio_temporal_voxel_layer uses the ros idl to create a service in the same cmake project that creates the shared library. I yanked this service and all the idl cmake directives from the package, and rebuilt. Then, I no longer get a missing symbol crash at run-time.

hidmic commented 3 years ago

@Jconn assuming your LD_LIBRARY_PATH was OK, does the spatio_temporal_voxel_layer library show the rosidl generated library as a dependency (hint: use ldd to check)?