rustcord icon indicating copy to clipboard operation
rustcord copied to clipboard

Bindgen unable to find libclang files

Open Lycoon opened this issue 5 years ago • 1 comments

  • Running cargo check
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.

Lycoon avatar Sep 26 '20 19:09 Lycoon

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

omerakgoz34 avatar Oct 19 '20 07:10 omerakgoz34