Skip to content

Commit c8a8222

Browse files
committed
Remove section about finding message libraries, obsoleted by build script
1 parent a49f4e5 commit c8a8222

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

docs/Building.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,13 @@ Running `cargo build` in `rclrs` will now work, as well as `cargo doc`, `cargo t
174174
175175
This can be ignored.
176176
177-
However, `cargo build` will not yet work for Rust packages that depend on message packages, like `rclrs_examples`:
178-
179-
180-
```
181-
/usr/bin/ld: cannot find -lrclrs_example_msgs__rosidl_typesupport_c
182-
/usr/bin/ld: cannot find -lrclrs_example_msgs__rosidl_generator_c
183-
collect2: error: ld returned 1 exit status
184-
```
185-
186-
That is, the linker does not know where to look for the `rclrs_example_msgs` libraries. This location is contained in an environment variable set by the `setup.sh` script for `rclrs_example_msgs`. So we can just source the `install/setup.sh`, and after that, `rclrs_examples` can be built.
187-
188177
To summarize:
189178
190179
```shell
191180
# Initial build of the package with colcon
192-
# The --lookup-in-workspace flag is optional
181+
# The --lookup-in-workspace flag is recommended for a cargo-based workflow
193182
# Compare .cargo/config.toml with and without it to see its effect
194183
colcon build --packages-up-to rclrs_examples --lookup-in-workspace
195-
. install/setup.sh
196184
cd src/ros2_rust/rclrs_examples
197185
# Run cargo build, or cargo check, cargo doc, etc.
198186
cargo build
@@ -207,7 +195,7 @@ How can a binary created in Rust be made available to `ros2 run`, `ros2 launch`
207195
208196
It's not necessary to learn about which marker file goes where. The functionality to properly set up the install directory was extracted from `colcon-ros-cargo` into a `cargo` plugin, so that `colcon` is not required: [`cargo-ament-build`](https://github.com/ros2-rust/cargo-ament-build).
209197
210-
Simply use `cargo ament-build --install-base <path to install dir>` as a drop-in replacement for `cargo build`. After building, simply `. install/setup.sh` and you're good to run your executable with `ros2 run`.
198+
Simply use `cargo ament-build --install-base <path to install dir>` as a drop-in replacement for `cargo build`. After building, run `. install/setup.sh` and you're good to run your executable with `ros2 run`.
211199
212200
213201
## Troubleshooting

0 commit comments

Comments
 (0)