我正在尝试学习LLVM,以便使用Rust创建一种编程语言。我使用的是包装LLVM的llvm-sys机箱。
我已经安装了LLVM:LLVM-8.0.0-win64
我在cargo.toml中的依赖项
[dependencies]
llvm-sys = "80.1.1"当我运行cargo run时,我得到以下错误:
Updating crates.io index
Compiling memchr v2.2.1
Compiling lazy_static v1.4.0
Compiling regex-syntax v0.6.12
Compiling semver-parser v0.7.0
Compiling libc v0.2.65
Compiling cc v1.0.47
Compiling thread_local v0.3.6
Compiling semver v0.9.0
Compiling aho-corasick v0.7.6
Compiling regex v1.3.1
Compiling llvm-sys v80.1.1
error: failed to run custom build command for `llvm-sys v80.1.1`
Caused by:
process didn't exit successfully: `C:\Users\Name\Desktop\Carbon\carbon-lang\target\debug\build\llvm-sys-ed5d351b1ae6a41b\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=LLVM_SYS_80_PREFIX
cargo:rerun-if-env-changed=LLVM_SYS_80_IGNORE_BLACKLIST
cargo:rerun-if-env-changed=LLVM_SYS_80_STRICT_VERSIONING
cargo:rerun-if-env-changed=LLVM_SYS_80_NO_CLEAN_CFLAGS
cargo:rerun-if-env-changed=LLVM_SYS_80_USE_DEBUG_MSVCRT
cargo:rerun-if-env-changed=LLVM_SYS_80_FFI_WORKAROUND
Didn't find usable system-wide LLVM.
--- stderr
thread 'main' panicked at 'Failed to execute "C:\\Program Files\\LLVM\\bin\\llvm-config": Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.但是我已经将LLVM_SYS_80_PREFIX设置为C:\Program Files\LLVM,这就是bin文件夹所在的位置。
是否应该单独安装llvm-config文件?我到处都找不到它。
仅供参考:我使用的是Windows 10
谢谢你的帮助!
发布于 2021-02-19 16:14:53
llvm-config是一个开发人员端工具,它不随二进制文件一起提供。您需要从源代码构建LLVM。
发布于 2021-02-19 01:36:49
LLVM没有附带一个名为llvm-config.exe的组件,但我不确定如何绕过它。
https://stackoverflow.com/questions/59015151
复制相似问题