Skip to content

Commit bbffd83

Browse files
DrRuheemilio
authored andcommitted
provide information how to link to shared objects
1 parent 7766ab7 commit bbffd83

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

book/src/tutorial-3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ bindings to `bzip2` at compile time. The resulting bindings will be written to
77
`$OUT_DIR/bindings.rs` where `$OUT_DIR` is chosen by `cargo` and is something
88
like `./target/debug/build/bindgen-tutorial-bzip2-sys-afc7747d7eafd720/out/`.
99

10+
Note that the associated shared object to `bz2` is `libbz2.so`. In general, a `lib<name>.so` should be referenced in the build file by `<name>`.
11+
1012
```rust,ignore
1113
extern crate bindgen;
1214
1315
use std::env;
1416
use std::path::PathBuf;
1517
1618
fn main() {
19+
// Tell cargo to look for shared libraries in the specified directory
20+
println!("cargo:rustc-link-search=/path/to/lib");
21+
1722
// Tell cargo to tell rustc to link the system bzip2
1823
// shared library.
1924
println!("cargo:rustc-link-lib=bz2");

0 commit comments

Comments
 (0)