summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakobgerhardt <jak.gerhardt@gmail.com>2022-04-26 23:40:12 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2022-05-08 00:59:20 +0200
commitbbffd83f0328095357465fe9a6e9eb3e311f4822 (patch)
treef813136e8e72fb580417a637b32ac8d4fb52b38c
parent7766ab7166dd5765850ac397a2c960e93de4a599 (diff)
provide information how to link to shared objects
-rw-r--r--book/src/tutorial-3.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/book/src/tutorial-3.md b/book/src/tutorial-3.md
index 139a24f9..dcd67c5c 100644
--- a/book/src/tutorial-3.md
+++ b/book/src/tutorial-3.md
@@ -7,6 +7,8 @@ bindings to `bzip2` at compile time. The resulting bindings will be written to
`$OUT_DIR/bindings.rs` where `$OUT_DIR` is chosen by `cargo` and is something
like `./target/debug/build/bindgen-tutorial-bzip2-sys-afc7747d7eafd720/out/`.
+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>`.
+
```rust,ignore
extern crate bindgen;
@@ -14,6 +16,9 @@ use std::env;
use std::path::PathBuf;
fn main() {
+ // Tell cargo to look for shared libraries in the specified directory
+ println!("cargo:rustc-link-search=/path/to/lib");
+
// Tell cargo to tell rustc to link the system bzip2
// shared library.
println!("cargo:rustc-link-lib=bz2");