ros / class_loader

ROS-independent library for dynamic class (i.e. plugin) introspection and loading from runtime libraries
http://www.ros.org/wiki/class_loader
35 stars 95 forks source link

Question: How to load library when dependencies are not in the LD_LIBRARY_PATH? #166

Closed Levi-Armstrong closed 4 years ago

Levi-Armstrong commented 4 years ago

I am currently releasing some visualization tools leveraging snap packages where they can be loaded dynamically using class_loader. In order for this to work correctly because the libraries dependencies are inside the snap packages folder and not in the LD_LIBRARY_PATH it fails to load. Now if I manually add the snap package path to the LD_LIBRARY_PATH it loads fine, but not a great solution because if globally added this could cause issues with other libraries using the snap packages resources. Does anyone have any ideas?

Levi-Armstrong commented 4 years ago

It looks like the best solution may be setting the RPATH of the plugin located in the snap package. I will test and report back.

Levi-Armstrong commented 4 years ago

Setting the RPATH solved the issue.