Installation, Hello World, Cargo
type
status
date
slug
summary
tags
category
icon
password
In this part, I will show you how to install Rust, create dictionary and the Package manager Cargo.
The version of Linux on my PC is Ubuntu 24.04.
The version of Rust I use is ** in date 2025.06.
๐ Installing rustup on Linux
What is Linker?
A linker is an essential tool in the process of compiling a program. It helps one to join compiled output into one file.
A C compiler is useful because it contains a linker and many Rust packages depending on C code needs C compiler.
Ubuntu offer a default gcc compiler.
You can use
to check your gcc version:
<b/>
You can see more about linker in Linker - GeeksforGeeks
Installing rustup
You can use
to download rustup, and you will see something like below in your terminal:
<b/>
You can also use
to update Rust to the newest version:
<b/>
๐ Hello world
Creating a Project Directory
Go to your choosen path and type:
As a rustacean, you should use UNC(Universal Naming Convention) which use โ_โ to seperate words in name of directory and variable etc.
Writing and running a Rust Program
Make a new source file and call it main.rs(I choose vim in this blog, you can use and editor you like, even Graphical Editor):
Type below into main.rs(type โIโ for vim user):
fn
is kind of like void main()
in C++ or def main()
in Python. We will see the difference in the future.Println!
is kind of like printf
in C++ or print
in Python. But in rust, a โ!โ is related to a concept Macro
, or more precisely, it calls a macro. I will explain it in the distant future(maybe untill the last one-third part of the tutorial).Save the file(for vim user):
Then go back to your terminal:
rustc
ย is the compiler for the Rust programming language, provided by the project itself../main
is running โmainโ command in Linux.๐ Hello world
Creating a Project with Cargo
Building and Running a Cargo project
๐ค Summary
๐ Reference
- My vedio on Youtube
ย
Any problems about Rust can be announced on my Youtube vedio comments.
Prev
test for this website
Next
Multiplication
Loading...