1. How to install rust language on termux
To install rust in termux execute the following cmd
1. pkg update && pkg upgrade
2. pkg install rust
if you are getting some error then try termux-change-repo to change the repo and select any random repo .
After that execute the same command
Confirm the installation of rust on termux by executing `rustc --version` command , you should get version installed on your termux.
2. Now install any text editor that you like , you are going to write hello word program in rust
I am using vim as a text editor for a while now , so i will use that
Run these commnad
vim hello.rs
fn main() {
println!("Hello, world!");
}
save the file now it's time to run it,
rustc hello.rs
rust will generate a executable binary
./hello
Thanks
No comments:
Post a Comment