Merge pull request #7 from Arker123/rust-hello

Added Rust binary with 'Hello world' program
This commit is contained in:
Willi Ballenthin 2023-05-26 09:29:03 +02:00 committed by GitHub
commit 92a48bec0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 0 deletions

7
src/rust-hello/Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "hello-world-cargo"
version = "0.1.0"

View file

@ -0,0 +1,8 @@
[package]
name = "hello-world-cargo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

52
src/rust-hello/Readme.md Normal file
View file

@ -0,0 +1,52 @@
## Hello World Rust Binary
### Prerequisites
Before proceeding, ensure that you have the following prerequisites installed:
- Rust: The Rust programming language and its package manager, Cargo. You can install Rust by following the instructions provided on the [official Rust website].
### Building the binary
Build the binary using Cargo:
To build the "Hello World" Rust binary, follow these steps:
1) Clone the repository to your local machine:<br>&emsp;
```git clone https://github.com/your-username/hello-world-rust.git```
2) Navigate to the project directory:<br>&emsp;
```cd hello-world-rust```
3) Build the binary using Cargo:
For Debug profile:
- 32-bit Windows machine:<br>&emsp;
```cargo build --target i686-pc-windows-gnu```
- 64-bit Windows machine:<br>&emsp;
```cargo build --target x86_64-pc-windows-gnu```
- 64-bit Linux machine:<br>&emsp;
```cargo build --target x86_64-unknown-linux-gnu```
For Release profile, replace build with build --release in the above commands.
The above commands will compile the Rust code and generate the binary based on the selected profile and target platform.
### Running the Binary
Once the binary is built, you can run it using the following command:
- For Debug profile:<br>&emsp;
```cargo run```
- For Release profile:<br>&emsp;
```cargo run --release```
### Version and Platform Information
The version of Rust used to build these binaries is 1.69.0, and the profile used was DEBUG. The binaries were compiled on Linux using LLVM.
The above commands will execute the binary and display the "Hello World" message in your terminal.
[official Rust website]: <https://www.rust-lang.org/tools/install>

Binary file not shown.

BIN
src/rust-hello/bin/rust-hello.exe Executable file

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}