1

I have a crate (https://github.com/wilbertom/bichannels) that is not registered on crates.io. I would like to add it to my current crate, as a dependency. I've tried going into its directory (placed inside the outer crate) and running cargo install, but that doesn't work, instead, giving this error:

error: no packages found with binaries or examples

So it appears that one can only install a binary crate, but how do I add a library crate to my dependencies? I've tried adding:

bichannels = "*"

to my Cargo.toml but that just says that this package is not on crates.io.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alexis Dumas
  • 1,299
  • 11
  • 30

1 Answers1

2

There are two options:

add this to Cargo.toml:

[dependencies]
"bichannels" = {git = "https://github.com/wilbertom/bichannels"}

Or git clone locally the lib and use:

[dependencies]
"bichannels" = {path = "<roor_dir_of_your_clone>"}
attdona
  • 17,196
  • 7
  • 49
  • 60