The most basic process helloword
As we mentioned earlier
The first step, the installation tool chain rust
https://www.rust-lang.org/tools/install
Next, create project
cargo new helloworld
You get a console application template source code as follows
fn main() {
println!("Hello, world!");
}The third step is to run the project
cd helloworld
cargo run
Or go directly to execute exe (windows only)
Note: rust in the window under the c ++ compiler needs vs connector, directly put on a vs2019 c ++ can be checked. You can also install vs2019 c ++ Toolkit alone
HERE
rust available IDE is not much choice here vscode
vscode the installation slightly
1. Install plug-in
This plug-in installed
2. Open the project
It opened above the door out of the cargo new helloworld project directory
Kazakhstan has syntax highlighting
3. Compile the project
Press the default build shortcut key ctrl shift B, menu items
Kazakhstan, with cargo build the compiler is to compile and generate exe (windows)
cargo check just to make the compiler checks (see if you can compile, if there is a watch model even more convenient, there may be, I beginner)
Point behind the gear icon, you can generate tasks.json
try to build it, colored text annotation Important Information
4. Commissioning Project
A breakpoint, hey how can not come (if you do not have control of vscode can break under this section)
File->Preferences->Settings
Open the settings, check the options as shown in red, you can break down
Press F5 or switch to debug mode is selected add configuration
I debugging in windows, using c ++ windows debugger can (no doubt, is the c ++ debugger)
At this point can not be debugged, there is no good convergence, exe file name to be changed their output
I am here is to change this (because I built the project called hello01)
Then you can have fun breakpoint debugging, the default shortcut F5, or switch to debug mode by pressing the small green triangle
Breakpoints hit below
Step into the menu out of suspension
Monitoring variables, call stack, these breakpoints displayed on the left.
At this point a rust console development environment is complete.