2017-02-06 25 views
3

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和貨物0.8.0。

我Cargo.toml從例如:

[package] 

name = "spinning-square" 
version = "0.1.0" 
authors = [ 
    "TyOverby <[email protected]>", 
    "Nikita Pekin <[email protected]>" 
] 

[[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" 
+0

你能告訴我們什麼'rustc -V'和'貨物-V'打印? –

+0

我添加了貨物和rustc的版本。此外,我還包括我遇到問題的示例中的Cargo.toml。 – Acais

+0

您可能需要升級rustc(和貨物)。上個星期發佈了1.15.0版本,顯然是1.7.0的兩倍成熟的數字:)從1.7.0開始就有很多波蘭語,特別是更清晰的錯誤消息,增加了穩定的API,...我建議你真的用'rustup'來得到1.15.0。 –

回答

2

我結束了使用

$ sudo apt install libsdl2-dev 

,然後開始工作。不過,我不知道這是否是真正的解決辦法,因爲我刪除libsdl2並繼續之後的工作。我的一個理論是,因爲活塞使用SDL2,修正它的東西,使其工作,也許。

如果有人已經找到了未來的傢伙更好的解決方案有問題,我將離開這個崗位沒有答案了一段時間。

+0

這是明智的保持這個答案不被接受。活塞並不嚴格依賴SDL 2,並且根本不需要您提到的依賴關係。 –

+0

如何解決Windows中的相同問題? – Casper