Skip to content

Rust and VS Code Setup for Rust Programming

Rust Setup for Windows

Setting up Rust on Windows is straightforward. Below are the steps to get Rust installed and ready for development on a Windows machine.

Install Rust
Rust provides an official installer for Windows.
1.1: Download the Installer:
Go to the official Rust website: https://www.rust-lang.org/.

Rust installation

Click on the “Get Started” button.

rustup.exe download

Download the rustup-init.exe installer for Windows.

1.2: Run the Installer:
Open the downloaded rustup-init.exe file.

run rust installer

Press the keyboard “Enter
Follow the prompts in the terminal. The installer will guide you through the installation process.
By default, it will install the stable version of Rust, along with cargo (Rust’s package manager) and other necessary tools.

1.3: Verify Installation:
1.3.1:  Open a new Command Prompt or PowerShell window.

1.3.2: Run the following command to verify that Rust is installed:

rustc --version

1.3.3: You should see the installed version of Rust, e.g., rustc 1.xx.x (stable).

Install a C++ Build Tools (Optional but Recommended)
Some Rust crates require a C++ compiler. On Windows, you can install the necessary build tools using the Visual Studio Build Tools.

2.1:Download Visual Studio Build Tools:
Go to the Visual Studio Downloads page.
https://visualstudio.microsoft.com/downloads/

Download the “Community” for free download. Open the download file.

2.2: Install the C++ Build Tools:

2.2.1: During installation,  scrolling and select the “Desktop development with C++” workload.

2.2.2: Ensure that the “MSVC v142 – VS 2019 C++ x64/x86 build tools” and “Windows 10 SDK” options are selected.(for Windows 10 user)

2.2.3: Click the‘’ Install” Button and start the installation.

After successfully installing Rust on your system, the next step is to download and set up Visual Studio Code (VS Code), a popular IDE for Rust development. Here’s how you can do it:

Download VS Code
Go to the official Visual Studio Code website: https://code.visualstudio.com/.

Click the Download button for your operating system (Windows, macOS, or Linux).
3.1:  Install VS Code
On Windows:
Run the downloaded installer (VSCodeSetup.exe).
Follow the installation prompts.

Vs code setup

Click next

vs code path add

Mark the box and click next

vs code install

Click Install

Once installed, launch VS Code.

vs code open

Set Up VS Code for Rust Development
Install the Some  Extension

1.rust-analyzer

rust-analyzer

2. CodeLLDB

CodeLLDB

3. Even Better TOML

Even Better TOML

4. Dependi

Dependi

5. Error Lens

Error Lens

6. Todo Tree

Todo Tree

7. GitHub Copilot

GitHub Copilot

Leave a Reply

Your email address will not be published. Required fields are marked *