错误:无法找到箱子

时间:2016-02-05 15:03:55

标签: rust rust-cargo

我试图使用this library 但是,cargo build说:

   Compiling test v0.1.0 (file:///C:/path/to/project/test)
src\main.rs:1:1: 1:28 error: can't find crate for `jvm_assembler` [E0463]
src\main.rs:1 extern crate jvm_assembler;
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `test`.

To learn more, run the command again with --verbose.

我的Cargo.toml就是这样:

[package]
name = "test"
version = "0.1.0"
authors = ["yomizu_rai"]

[dependencies]
jvm-assembler = "*"

src/main.rs就是这个,而且没有其他的源文件。

extern crate jvm_assembler;
use jvm_assembler::*;
fn main() {}

我认为我的Cargo.toml没有错,src/main.rs没有错误的余地 为什么不能找到jvm-assembler? 我该如何解决?

1 个答案:

答案 0 :(得分:2)

如果货物在crates.io上,货物只能按名称找到包装箱。在您的情况下,您需要指定git URL,请参阅Cargo文档中的section on dependencies