Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
672 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think you may have misunderstood package management with cargo. Since in3 is a library and not a binary crate, you cannot install it.

cargo install does not install dependencies like npm install or pip install does. cargo install will install binaries into your local filesystem (typically $HOME/.cargo/bin) for you to run.

Cargo will resolve dependencies for you when you cargo run/check/build. You do not need to install dependencies.

You may want to start a new folder structure and try the following:

  1. Run cargo init. This will create a new binary package
  2. Edit Cargo.toml and add the in3 dependency and version.
  3. Modify the main.rs file to use the in3 library.
  4. Run the program with cargo run. You will notice that cargo is resolving various dependencies while compiling your program.

For more info on Cargo, here is the getting started guide.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...