robo9k / rust-magic-sys

Rust declarations crate for the `libmagic` C library
Apache License 2.0
10 stars 6 forks source link

Compliling on windows and missing libmagic.so #29

Closed muteb closed 1 year ago

muteb commented 1 year ago

Hi guys, I am trying to compile magic on windows 10 and I face this issue. I install libmagic through vcpkg and set the environment to see the directory but no luck

Caused by:
  process didn't exit successfully: `C:\Users\user\Documents\rust\filem\target\debug\build\magic-sys-2c574dcd88b09256\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_MAGIC_DIR
  cargo:rerun-if-env-changed=MAGIC_DIR
  cargo:rustc-link-search=native=C:\vcpkg\packages\libmagic_x64-windows
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_MAGIC_STATIC
  cargo:rerun-if-env-changed=MAGIC_STATIC

  --- stderr
  thread 'main' panicked at 'No libmagic.so , nor libmagic.a  found in "C:\\vcpkg\\packages\\libmagic_x64-windows"', C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\magic-sys-0.3.0\build.rs:30:21
robo9k commented 1 year ago

Could you give a bit more detail on why you're using the standalone vcpkg CLI instead of cargo-vcpkg?

How did you create your vcpkg root, i.e. which git revision are you using and which packages did you install? I assume you are not setting the right environment variables. Given your output, you could try the following:

cargo clean
set VCPKG_ROOT=C:\vcpkg
cargo build
muteb commented 1 year ago

Yes thanks alot. This works for me