使用println!时,rustc不会向终端输出任何内容。
代码:
fn main() {
println!("Hello, world!");
}运行它:
me@mclaptop:~
> rustc helloworld.rs
me@mclaptop:~
>为什么它不打印任何内容?
发布于 2019-10-13 01:00:40
rustc是Rust语言的编译器,它只是生成一个要运行的可执行文件。如果您想实际查看输出,则必须运行./helloworld命令。
你可以在here上读到它。
发布于 2019-10-13 01:00:06
rustc只编译你的代码。您需要调用输出二进制文件才能使其工作。
尝试使用./helloworld或输出文件的其他名称。
https://stackoverflow.com/questions/58356395
复制相似问题