Development

How to install and setup the Rust Compiler on Windows

Through this tutorial, you will discover how to setup a Rust development environment on Windows in simple steps.
Captain Salem 3 min read
How to install and setup the Rust Compiler on Windows

Rust is a free and open-source low-level programming language developed Graydon Hoare in 2006. Rust is an incredible powerful language that offers low-level control while removing the restrictions and dangers of manual memory management. No, it does not use a garbage collector.

Rust is a popular choice in environments where performance and reliability is of utmost importance. Example would include system kernels, database engine, game engines, networking protocols, browsers and more.

The Rust syntax is comparable to that of C++, provides performance on par with modern C++, and for many experienced developers, Rust is easily adopted and manageable.

Rust Toolchain and Ecosystem

When developing in Rust, you will come across the following features:

  • A crate is a Rust unit of compilation and linking. A crate can exist in source code form, and from there it can be processed into a crate in the form of either a binary executable (binary for short), or a binary library (library for short).
  • A Rust project is known as a package. A package contains one or more crates, together with a Cargo.toml file that describes how to build those crates.
  • rustup is the installer and updater for the Rust toolchain.
  • Cargo is the name of Rust's package management tool.
  • rustc is the compiler for Rust. Most of the time, you won't invoke rustc directly; you'll invoke it indirectly via Cargo.
  • crates.io (https://crates.io/) is the Rust community's crate registry.

Step 1 - Installing Rust

To install Rust, open your browser and head over to the Rust page.

https://www.rust-lang.org/

Click on the Get Started option to get to the download's page. The website will automatically detect your operating system and provide installers for your system.

Select the installer package for your system and download.

Once the download is complete, launch the installer package and follow along the provided instructions. Choose option 1 to setup Visual C++ Build Tools.

Click install to begin the download and installation process.

image-20220928024934913

This process may take a few minutes to complete.

Once the process is complete, click Ok to close the Build Tools installer and head back to the rust installation processes.

The rust installer package will download and install all the required components such as cargo, rust compiler, documentation, etc.

Once completed, you should see a message as shown:

image-20220928025415001

Press the Enter key to complete teh process.

Bonus - Install Microsoft C++ Build Tools and Additional Tools

As an added bonus, you can install the Build Tools and other development components as shown in the sections below:

Open your browser and navigate to the resource below:

https://visualstudio.microsoft.com/visual-cpp-build-tools/

Screenshot 2022-09-28 at 02.21.50

Download build tools and start the installer.

Click Continue on the setup Window

Screenshot 2022-09-28 at 02.23.08

On the Components Window, select—.NET desktop development, Desktop development with C++, and Universal Windows Platform development.

Finally, click install to begin the installation process.

image-20220928022951149

Once you are done, you can proceed with your Rust development.

Closing

In this article, we explored the process of downloading and installing the Rust compiler on Windows 11. If this article helped you, feel free to share and leave us a comment down below.

Check out our other tutorials and let us know if you want to see other Rust tutorials.

Thanks for reading!!

If you enjoy our content, please consider buying us a coffee to support our work:

Share
Comments
More from GeekBits

Join us at GeekBits

Join our members and get a currated list of awesome articles each month.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to GeekBits.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.