我开始了“为rubyists生锈”教程,这段代码让我感到高兴:
extern mod std;
#[test]
fn this_tests_code() {
println("")
}
fn main() {
}
尝试编译这个让我:
> rustc testing.rs
testing.rs:1:0: 1:0 error: multiple matching crates for `core`
testing.rs:1 extern mod std;
^
note: candidates:
note: path: /usr/local/lib/rustc/x86_64-apple-darwin/lib/libcore-c3ca5d77d81b46c1-0.5.dylib
note: meta: name = "core"
note: meta: vers = "0.5"
note: meta: uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8"
note: meta: url = "https://github.com/mozilla/rust/tree/master/src/libcore"
note: path: /usr/local/lib/rustc/x86_64-apple-darwin/lib/libcore-c3ca5d77d81b46c1-0.6.dylib
note: meta: name = "core"
note: meta: vers = "0.6"
note: meta: uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8"
note: meta: url = "https://github.com/mozilla/rust/tree/master/src/libcore"
error: aborting due to previous error
我正在使用rustc 0.6。我不确定它应该做什么,所以有人能给我一些见解吗?谢谢!
答案 0 :(得分:5)
您似乎安装了两个版本的libstd,0.5和0.6。你应该删除旧的:
/usr/local/lib/rustc/x86_64-apple-darwin/lib/libcore-c3ca5d77d81b46c1-0.5.dylib
或者更具体地说明要链接哪个库:
extern mod std (vers = "0.6");