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

Categories

0 votes
834 views
in Technique[技术] by (71.8m points)

blockchain - How do I install the Rust crate in3?


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

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...