Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
- [Annotating types with `#[must-use]`](./must-use-types.md)
- [Field visibility](./visibility.md)
- [Code formatting](./code-formatting.md)
- [Libloading](./libloading.md)

- [Generating Bindings to C++](./cpp.md)
- [Generating Bindings to Objective-c](./objc.md)
- [Using Unions](./using-unions.md)
Expand Down
8 changes: 8 additions & 0 deletions book/src/libloading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
It is also possible to generate bindings for loading a shared library via the `libloading` crate.
To generate libloading bindings for a library `shared_lib` we can either use the function `dynamic_library_name` function in `build.rs` or the CLI argument `--dynamic-loading` when using the bindgen CLI.

Here is an example using the bindgen CLI:
```
bindgen wrapper.h --dynamic-loading MySharedLib --output bindings.rs
```
Bindgen will generate a `libloading` struct matching the name of the `--dynamic-loading` argument. So in the case of the example above the generated struct will have the name `MySharedLib`.
Loading