gpt4 book ai didi

rust - Cargo 无法在 Windows 10 上编译 rust-qml

转载 作者:行者123 更新时间:2023-11-29 08:13:57 24 4
gpt4 key购买 nike

我想在 Windows 10 上使用 Rust 制作一个 GUI 应用程序,我找到了 the qml crate看起来不错。

我在我的 Cargo.toml 文件中添加了这个依赖项:qml = "0.0.9",但是当我运行 cargo build 时,我收到此错误:

> cargo build
Compiling qml v0.0.9
error: failed to run custom build command for `qml v0.0.9`
process didn't exit successfully: `project\target\debug\build\qml-018515e4bf91189d\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'failed to execute process: The specified file cannot be found. (os error 2)', user\.cargo\registry\src\github.com-1ecc6299db9ec823\qml-0.0.9\build.rs:28:33
note: Run with `RUST_BACKTRACE=1` for a backtrace.

我查看了 build.rs 文件并看到了这一行:

fs::copy(Path::new(&manifest_dir).join("build_lib.sh"), Path::new(&out_dir).join("build_lib.sh")).unwrap();

也许我没有权限在我的帐户上执行此操作,所以我尝试以管理员身份运行它,但 cargo 和 rustc 安装在我的用户文件夹中。

当我更改路径时,出现错误 error: no default toolchain configured

最佳答案

QML 0.0.9's build script doesn't support Windows .

似乎在 80ccad26 中添加了对 Windows 的支持,似乎还没有发布。

您需要使用版本 from the git repository相反:

[dependencies]
qml = { git = "https://github.com/White-Oak/qml-rust" }

关于rust - Cargo 无法在 Windows 10 上编译 rust-qml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50258044/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com