Warning
This post was published 31 days ago. The information described in this article may have changed.
Error: renaming of the library `hpdfcargo` was specified, however this crate contains no `#[link(...)]` attributes referencing this library
โ Rust ๐ 2025-08-06 ๐ค surdeus ๐๏ธ 7I am trying to generate bindings for libharu using bindgen, following the exact procedure mentioned on the website. Hereโs my build.rs file
use std::{env, path::PathBuf};
fn main()
{
println!("cargo::rustc-link-search=/usr/local/lib");
print!("cargo::rustc-link-lib=static=hpdf");
let bindings = bindgen::Builder::default()
.header("src/libharu/libharu.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("Unable to generate libharu bindings\n");
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings.write_to_file(out.join("bindings.rs")).unwrap();
}
However, if I run `cargo run` I get this error. I do know that there are bindings available on crates.io. However, I want to use the newer version of libharu.
1 post - 1 participant
๐ท๏ธ Rust_feed