Rust 程序设计语言 简体中文版 1.85.01.0 (file:///projects/hello_cargo) Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs 这个命令会创建一个可执行文件 target/debug/hello_cargo (在 Windows 上是 targetdebughello_cargo.exe),而不是放在目前目录下。由于默认的构建方法是调试构建 建方法是调试构建 (debug build),Cargo 会将可执行文件放在名为 debug 的目录中。可以通过这个命令运行可 执行文件: $ ./target/debug/hello_cargo # 或者在 Windows 下为 .\target\debug\hello_cargo.exe Hello, world! 19/562Rust 程序设计语言 简体中文版 如果一切顺利,终端上应该会打印出 build 构建了项目,并使用 ./target/debug/hello_cargo 运行了程序,也 可以使用 cargo run 在一个命令中同时编译并运行生成的可执行文件: $ cargo run Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs Running `target/debug/hello_cargo`0 码力 | 562 页 | 3.23 MB | 25 天前3
共 1 条
- 1













