美文网首页Rust
Cargo-New Project

Cargo-New Project

作者: 空乱木 | 来源:发表于2019-10-26 20:28 被阅读0次

1-创建可执行
[@zhous-MBP-2:] ~/blockchain/rust cargo new hello_cargo --bin Created binary (application) `hello_cargo` package [@zhous-MBP-2:] ~/blockchain/rust ls -l
total 0
drwxr-xr-x 6 zhouhe staff 192 Oct 26 20:27 hello_cargo
[@zhous-MBP-2:] ~/blockchain/rust $

2-目录结构
[@zhous-MBP-2:] ~/blockchain/rust cd hello_cargo/ [@zhous-MBP-2:] ~/blockchain/rust/hello_cargo tree
.
├── Cargo.toml
└── src
└── main.rs

1 directory, 2 files
[@zhous-MBP-2:] ~/blockchain/rust/hello_cargo $

3- 运行
[zhouhe@zhous-MBP-2:] ~/blockchain/rust/hello_cargo cargo run Compiling hello_cargo v0.1.0 (/Users/zhouhe/blockchain/rust/hello_cargo) Finished dev [unoptimized + debuginfo] target(s) in 1.31s Running `target/debug/hello_cargo` Hello, world! [zhouhe@zhous-MBP-2:] ~/blockchain/rust/hello_cargo

相关文章

网友评论

    本文标题:Cargo-New Project

    本文链接:https://www.haomeiwen.com/subject/xuuuvctx.html