Skip to content
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

Doesn't build with libheif 1.19+ #28

Open
felixonmars opened this issue Nov 10, 2024 · 3 comments
Open

Doesn't build with libheif 1.19+ #28

felixonmars opened this issue Nov 10, 2024 · 3 comments
Assignees

Comments

@felixonmars
Copy link

There appears to be some API changes: strukturag/libheif@ecdeb8f#diff-3d7d4ade3135524be963ec0b461e86d0b1fbfef0c1083a1f2230811a92ac9a17R77

   Compiling libheif-rs v1.0.2
error[E0063]: missing fields `preload_range_hint`, `release_error_msg`, `release_file_range` and 1 other field in initializer of `heif_reader`
   --> /usr/src/debug/glycin/build/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/libheif-rs-1.0.2/src/reader.rs:104:50
    |
104 | pub(crate) static HEIF_READER: lh::heif_reader = lh::heif_reader {
    |                                                  ^^^^^^^^^^^^^^^ missing `preload_range_hint`, `release_error_msg`, `release_file_range` and 1 other field

For more information about this error, try `rustc --explain E0063`.
error: could not compile `libheif-rs` (lib) due to 1 previous error```
@Cykooz Cykooz self-assigned this Nov 10, 2024
@Cykooz
Copy link
Owner

Cykooz commented Nov 12, 2024

At the moment I haven't finished a version of libheif-rs with support for libheif 1.19.
However, if you are using Linux on x86_64 architecture, you can use the current version of libheif-rs with libheif 1.19 if you disable the default features of the crate in your Cargo.toml.:

[dependencies]
libheif-rs = { version = "1.0.2", default-features = false }

When libheif 1.19 becomes available in Microsoft's vcpkg, I will add support for it.

@felixonmars
Copy link
Author

Thanks. I have verified that this fixes it on x86_64. But unfortunately I'm trying to build it on riscv64 :(

@Cykooz
Copy link
Owner

Cykooz commented Nov 14, 2024

I have released libheif-sys 2.2.0 with the following changes:

  • .h files from libheif were embedded in the crate sources.

  • Changed build.rs to use embedded .h files for the bindgen build stage
    instead of .h files from the installed libheif library.

    Now you can link the crate with any version of libheif
    that is backward compatible with the version supported by the crate.

So you can remove the changes I suggested earlier and try to do a cargo update to use this new version of libheif-sys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants