AregevDev / rustcord

A safe wrapper around the Discord Rich Presence API
Apache License 2.0
15 stars 7 forks source link

Bindgen unable to find libclang files #6

Open Lycoon opened 3 years ago

Lycoon commented 3 years ago
Compiling rustcord-sys v0.2.4
error: failed to run custom build command for `rustcord-sys v0.2.4`

Caused by:
  process didn't exit successfully: `C:\Users\pc\Desktop\Dev\Projets Rust\epita-api\target\debug\build\rustcord-sys-577a2677be97ad62\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'clang.dll\', \'libclang.dll\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', C:\Users\pc\.cargo\registry\src\github.com-1ecc6299db9ec823\bindgen-0.52.0\src/lib.rs:1895:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

My guess is that rustcord-sys 0.2.4 dep uses an outdated version of Rust libclang wrapper, where neither clang.dll nor libclang.dll can be find. I refer to the following issue that has apparently been fixed on 28th July 2019.

omerakgoz34 commented 3 years ago

You need to add Clang "lib" or "bin" folder to the env.

Screenshot_6

or typing setx LIBCLANG_PATH "C:\clang\lib"

https://rust-lang.github.io/rust-bindgen/requirements.html#windows