在我试图使用cargo编译项目时:
C:\Users\Administrator\OneDrive\桌面\Rust\openrust>cargo build
Compiling clang-sys v1.8.1
Compiling regex v1.10.4
Compiling jobserver v0.1.31
Compiling maplit v1.0.2
The following warnings were emitted during compilation:
warning: clang-sys@1.8.1: could not execute `llvm-config` one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid `llvm-config` executable it will be used to try to find an instance of `libclang` on your system: "couldn't execute `llvm-config --prefix` (path=llvm-config) (error: program not found)"
error: failed to run custom build command for `clang-sys v1.8.1`
Caused by:
process didn't exit successfully: `C:\Users\Administrator\OneDrive\桌面\Rust\openrust\target\debug\build\clang-sys-5f7e6fd30ae4a8a1\build-script-build` (exit code: 101)
--- stdout
cargo:warning=could not execute `llvm-config` one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid `llvm-config` executable it will be used to try to find an instance of `libclang` on your system: "couldn't execute `llvm-config --prefix` (path=llvm-config) (error: program not found)"
--- stderr
thread 'main' panicked at C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clang-sys-1.8.1\build\dynamic.rs:225:45:
called `Result::unwrap()` on an `Err` value: "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: [])"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
非常棘手,不知道如何解决啊。