mirror of
https://github.com/vee1e/flare-floss-testfiles.git
synced 2026-09-01 18:57:01 +00:00
Merge pull request #7 from Arker123/rust-hello
Added Rust binary with 'Hello world' program
This commit is contained in:
commit
92a48bec0d
7 changed files with 70 additions and 0 deletions
7
src/rust-hello/Cargo.lock
generated
Normal file
7
src/rust-hello/Cargo.lock
generated
Normal 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"
|
||||
8
src/rust-hello/Cargo.toml
Normal file
8
src/rust-hello/Cargo.toml
Normal 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
52
src/rust-hello/Readme.md
Normal 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> 
|
||||
```git clone https://github.com/your-username/hello-world-rust.git```
|
||||
|
||||
2) Navigate to the project directory:<br> 
|
||||
```cd hello-world-rust```
|
||||
3) Build the binary using Cargo:
|
||||
For Debug profile:
|
||||
|
||||
- 32-bit Windows machine:<br> 
|
||||
```cargo build --target i686-pc-windows-gnu```
|
||||
|
||||
- 64-bit Windows machine:<br> 
|
||||
```cargo build --target x86_64-pc-windows-gnu```
|
||||
|
||||
- 64-bit Linux machine:<br> 
|
||||
```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> 
|
||||
```cargo run```
|
||||
|
||||
- For Release profile:<br> 
|
||||
```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>
|
||||
BIN
src/rust-hello/bin/hello-world-cargo
Executable file
BIN
src/rust-hello/bin/hello-world-cargo
Executable file
Binary file not shown.
BIN
src/rust-hello/bin/rust-hello.exe
Executable file
BIN
src/rust-hello/bin/rust-hello.exe
Executable file
Binary file not shown.
BIN
src/rust-hello/bin/rust-hello64.exe
Executable file
BIN
src/rust-hello/bin/rust-hello64.exe
Executable file
Binary file not shown.
3
src/rust-hello/src/main.rs
Normal file
3
src/rust-hello/src/main.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue