Skip to content

Troubleshooting libraries of custom messages not being found #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,12 @@ If you've deleted your `install` directory but not your `.cargo` directory, you'
> error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`

Delete the `.cargo` directory, and rebuild.


### Can not find library at runtime

If you `cargo run` a package that depends on a custom message, or some other dynamic library outside of the ROS 2 distribution, you will see an error from the dynamic linker such as:

> target/debug/message_demo: error while loading shared libraries: librclrs_example_msgs__rosidl_typesupport_c.so: cannot open shared object file: No such file or directory

To help your executable find the library, one possibility is to source the install directory which contains the message (or other library) package. This will add the required entry to the `$LD_LIBRARY_PATH` variable.