Cykooz / libheif-rs

Safe wrapper to libheif-sys for parsing heif/heic files
MIT License
34 stars 11 forks source link

`cargo build` fails on Windows #25

Closed h4chi closed 5 months ago

h4chi commented 5 months ago

Meta

cargo = 1.77.2
cargo-vcpkg = 0.1.7
libheif-rs = "1.0.1"

Issue

On building after install libheif through vcpkg on Windows using cargo vcpkg -v build, I get the following error:

Compiling libheif-sys v2.1.0+1.17.4
The following warnings were emitted during compilation:     

warning: libheif-sys@2.1.0+1.17.4: Could not find library in Vcpkg tree package libheif is not installed for vcpkg triplet x64-windows-static-md

error: failed to run custom build command for `libheif-sys v2.1.0+1.17.4`

Caused by:
  process didn't exit successfully: `<path>\src\target\debug\build\libheif-sys-d3d03489525c29ef\build-script-build` (exit code: 1)
  --- stdout
  cargo:warning=Could not find library in Vcpkg tree package libheif is not installed for vcpkg triplet x64-windows-static-md

Output from vcpkg list

libde265:x64-windows                              1.0.15              Open h.265 video codec implementation.
libheif:x64-windows                               1.17.6#1            libheif is an HEIF and AVIF file format decoder ...
libheif[hevc]:x64-windows                                             HEVC encoding via x265
vcpkg-cmake-config:x64-windows                    2022-02-06#1        
vcpkg-cmake:x64-windows                           2024-04-18
x265:x64-windows                                  3.5                 x265 is a H.265 / HEVC video encoder application...
h4chi commented 5 months ago

Fixed it by:

  1. Manually installing libheif:x64-windows-static-md using vcpkg
  2. Installing llvm and clang and putting them in path.