TLDR? If you just want to see the full working example crate, generating bzip2 bindings on-the-fly, it is available on Github here. Table of Contents Motivation Step 1: Adding bindgen as a Build Dependency Step 2: Create a wrapper.h Header Step 3: Create a build.rs File Step 4: Include the Generated Bindings in src/lib.rs Step 5: Write a Sanity Test Step 6: Publish Your Crate! Motivation Often tim