Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: can't find crate

I'm trying to use this library.
But, cargo build says this:

   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.

My Cargo.toml is this:

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

[dependencies]
jvm-assembler = "*"

src/main.rs is this, and there are no other sourcefiles.

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

I think my Cargo.toml is not wrong, and src/main.rs has no room for mistake.
Why can not rustc find jvm-assembler?
How do I resolve?

like image 371
yumizu rai Avatar asked Oct 18 '22 16:10

yumizu rai


1 Answers

Cargo can only find crates by name if they are on crates.io. In your case you need to specify the git URL, see the section on dependencies in the Cargo documentation.

like image 198
starblue Avatar answered Oct 21 '22 06:10

starblue