gpt4 book ai didi

rust - 下载依赖项时出现 "given version requirement is invalid"

转载 作者:行者123 更新时间:2023-11-29 08:00:28 25 4
gpt4 key购买 nike

正在关注 this example :

$ cargo build --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
failed to parse registry's information for: wayland-client

Caused by:
the given version requirement is invalid

这发生在每个示例上,并从其他存储库构建。我正在运行 Ubuntu 16.04 LTS,我通过 apt 安装了 Cargo 和 Rustc。使用版本:rustc 1.7.0 和 cargo 0.8.0。

示例中的我的 Cargo.toml:

[package]

name = "spinning-square"
version = "0.1.0"
authors = [
"TyOverby <ty@pre-alpha.com>",
"Nikita Pekin <contact@nikitapek.in>"
]

[[bin]]
name = "spinning-square"

[dependencies]
piston = "0.31.1"
piston2d-graphics = "0.21.1"
pistoncore-glutin_window = "0.35.0"
piston2d-opengl_graphics = "0.40.0"

最佳答案

我最终使用了

$ sudo apt install libsdl2-dev

然后它开始工作了。但是,我不知道这是否是真正的解决方案,因为我删除了 libsdl2 并且之后它继续工作。我的一个理论是,因为 Piston 使用 sdl2,所以它可能会纠正一些使其工作的东西。

如果有人为下一个遇到问题的人找到了更好的解决方案,我将让这篇文章暂时无人回复。

关于rust - 下载依赖项时出现 "given version requirement is invalid",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42075710/

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