【问题标题】:Cargo fails to compile rust-qml on Windows 10Cargo 无法在 Windows 10 上编译 rust-qml
【发布时间】:2018-10-19 20:20:32
【问题描述】:

我想在 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

【问题讨论】:

    标签: rust qml rust-cargo


    【解决方案1】:

    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" }
    

    【讨论】:

    • @Ardakaniz 在这种情况下,可能值得(礼貌地!)要求维护者发布一个新版本。
    • 最后一次修改是1年前的,现在还在维护吗?
    • @Ardakaniz 我实际上并不知道,但让业主知道有兴趣可能有助于激励他们继续工作。或者,如果它有用,其他人(或你?)可能会站出来帮助维护它!
    猜你喜欢
    • 2015-12-13
    • 2022-11-10
    • 2017-10-01
    • 2020-01-15
    • 1970-01-01
    • 2022-09-25
    • 2020-01-06
    • 1970-01-01
    • 2022-01-20
    相关资源
    最近更新 更多