gifnksm / emscripten-sys

Emscripten API bindings for Rust
Apache License 2.0
18 stars 4 forks source link

Cannot compile on Windows: libclang could not be found #10

Open kaba2 opened 6 years ago

kaba2 commented 6 years ago

On Windows, as part of building another rust package with emscripten-sys as dependency, I get the following error:

Compiling emscripten-sys v0.3.2
error: failed to run custom build command for `emscripten-sys v0.3.2`
process didn't exit successfully: `C:\Code\rust-webgl2-example-master\target\release\build\emscripten-sys-6f7d5d41753ba49d\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library could not be opened: C:\\Program Files (x86)\\LLVM\\bin\\libclang.dll"', libcore\result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

While I do have libclang.dll at that directory, perhaps this error is because it should point to c:\code\emsdk\clang\e1.37.36_64bit (or similar) instead, where I have emsdk installed?

My path starts like this:

PATH=C:\Code\emsdk;C:\Code\emsdk\clang\e1.37.36_64bit;...

and C:\Program Files (x86)\LLVM\bin comes later. So it seems it should find emsdk's clang first, by Windows's path-lookup rules. Running "where libclang.dll" verifies Windows finds emsdk's libclang.dll first. Any ideas?