-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrap_static_fns is missing from bindgen::Builder #2959
Comments
My first bet is that you're not actually using 0.70.1 as the released crate clearly has this method: https://docs.rs/bindgen/0.70.1/bindgen/struct.Builder.html#method.wrap_static_fns The command line version is also wrong as you're passing
That means that you must pass |
@pvdrz you are right about the command line, I changed it to
and it worked. However I'm not sure about the crate, I believe I am on 0.70.1.
and my Cargo.lock also says 0.70.1
I tried deleting Cargo.lock and target/ folder and rebuild, the same result as before I shift-click on bindgen::Builder to see the underlying code, it takes me to a path in ~/.cargo/ that looks like the right version 0.70.1, but the wrap_static_fns function is nowhere to be found Here is the content of the ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.70.1 folder if it helps And here is my project's source code, maybe someone can try to reproduce |
I think that's because you're missing the |
@pvdrz could you point to an example or tutorial? The tutorial at https://rust-lang.github.io/rust-bindgen/introduction.html as well as #2405 does not have anything on this Edit:
and it worked. I think these things need to be mentioned in the pages that talk about |
yeah this might have been an oversight. But the next version of bindgen won't require the |
Hi, I think I'm going crazy, I have been trying to use an external C library in my Rust program without success.
The C library is
uhubctl
, source code is here https://github.com/mvp/uhubctl/tree/masterAs you can see most of the important functions are declared as static functions, for instance
And I need to expose them to my Rust program.
After struggling for a while, I realise that the bindings.rs file generated by Bindgen doesn't contain anything, and I also realised that I need the
wrap_static_fns
flag. Allegedly it should be a method in bindgen::Builder.However, my VSCode keeps saying that the method is not found, and
cargo build
gives the same result.If I run the command line version
I get
I am also a total beginner in Rust so I'm completely lost.
I am on macOS Sonoma 14.6.1,
rustc 1.82.0
bindgen 0.70.1
Here is my build.rs
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: