I am running Linux Mint 19.2 Tina - as per tutorial in specified folders creating main.rs with this code
fn main() {
println!("Hello, world!");
}
running "rustc main.rs" - seems to pause a second and then just bring up a new prompt, as if nothing happened. No Hello World. In the directory /home/projects/hello_word/ there are two files main and main.rs.
My rustc --version is: rustc 1.40.0 (73528e339 2019-12-16)
Where did I go wrong? Is there something else I can insert into the code that might help with troubleshooting?
Rust is compiled language. It means that the program running consists of two phases: compilation, i.e. translation from the Rust code into the native machine code, and execution of the resulting code.
When you run rustc main.rs, you're instructing compiler to do compilation phase. It would read the file passed in (and all modules defined in it, if there were any), check syntax, check types, etc., and then generate the executable file, which by default has the same name as the source file, but without extension (on Linux) on with extension .exe (on Windows). To run the program, you simply run this executable file - in you case it'll be `./main'.
You can check this in the Book, which I hightly recommend anyway.