"Disclaimer: Copyright, reproduced Please specify the source, do not use for commercial purposes." Contact mailbox: [Email protected] "
1. Rust1.1 Installation Rust
Go to the Rust website to download the installation files for each Windows platform, it is recommended that you download the stable version. If the download speed is slow, you can also click to open the Baidu cloud disk for download. Once the download is complete, you can start the installation. The entire installation process is simple and Windows users open the. msi installation file. It is recommended that you choose Advanced Mode , which is more flexible, and you can automatically add environment variables to the system after the installation is complete.
After the installation is complete, you can open the console, enter rust -V
, view the current rust version, and verify that the installation is complete.
1.2 Download Rust Source
If you're just compiling rust, just refer to 1.1 to install rust. But then you need to use the Eclipse plugin and racer to develop the rust project, you must download the rust source code. The source code can also be downloaded to the Rust website to guarantee a version of 1.1 downloads. If the download speed is slow, you can also click to open the Baidu cloud disk for download.
Next you can extract the rust source, and I'll unzip it into my own Rust project folder E:\Program\Rust\
.
Finally set the environment variable of the rust source path RUST_SRC_PATH=E:\Program\Rust\rustc-1.0.0
, we need to set up according to the decompression path of the previous step.
2, Racer
RACER = Rust Auto-complete-er is an open source rust auto-complete tool. Home: Https://github.com/phildawes/racer.
Click Download and unzip or direct git to clone its source to rust project path, I'm still here E:\Program\Rust\
.
Next you need to compile racer. Open the terminal, enter the Racer directory that you just downloaded, enter cargo build --release
, wait for the command to complete successfully, the whole compilation process, such as.
3. Eclipse3.1 Download Eclipse
If the computer already has eclipse, the version is Luna or higher, and eclipse with the CDT plugin can be ignored. Eclipse IDE for C + + DEVELOPERS:HTTP://WWW.ECLIPSE.ORG/DOWNLOADS/PACKAGES/ECLIPSE-IDE-CC-DEVELOPERS/LUNASR2. It is recommended that you download this version of Eclipse, which has the CDT plugin, which is needed for development.
3.2 Installing the RUSTDT plug-in
Rustdt is the eclipse plugin for rust. This is an open source plug-in, interested friends can see the details of Https://github.com/RustDT/RustDT.
Open Eclipse, select Help -> Install New Software
, install plug-in. Plugin address: https://rustdt.github.io/releases/. There are a lot of details on the online Eclipse installation plugin, which is not covered here. It is important to note that after the link is requested, there will be a lot of plug-ins, here only choose RustDT Project
to install,
3.3 Configuring the Rustdt Plugin
Open Windows->Preferences->Rust
, configure my configuration according to your environment.
4. Hello World
Open Eclipse, default is the C + + view, click the upper right corner + sign to select Rust View, as.
Next, create a new Hello World project. After the project is built, the default is to create a new file in the SRC folder main.rs
, open this file, you can see that there is already a Hello world in the Rust code.
If automatic compilation is not turned on. Right-click Build project on the item.
Select Run as->run configurations, double-click Rust Application, and in program path select the compiled Hello World executable, such as. Click Run to see it in the console Hello, world!
.
At this point you can also enter in the Main.rs std::io::B
, and then press Alt + /
, you can see the auto-completion of the function has been configured successfully. Such as.
The Eclipse development environment in rust has been configured and the rust journey is officially opened.
Eclipse (RUSTDT) + Racer + Windows platform Rust development environment building