tech:notes_rust_lang_compilation
Notes rust lang compilation
Voir :
sudo apt-get install cargo
cargo new hello-world cd hello-world/
src/main.rs
fn main() { println!("Hello, world!"); }
Compilation
Compilation basique
rustc src/main.rs
Compilation statique
sudo apt-get install librust-rustup-dev rustup rustup default stable rustup target add x86_64-unknown-linux-musl cargo build --target=x86_64-unknown-linux-musl
$ ldd ./target/x86_64-unknown-linux-musl/debug/hello-world
statically linked
Compilation 32bits pour windows
rustup target add i686-pc-windows-gnu cargo build --target=i686-pc-windows-gnu # cargo build --release --target=i686-pc-windows-gnu wine target/i686-pc-windows-gnu/debug/hello-world.exe
Compilation 32bits statique pour GNU/Linux
rustup target add i686-unknown-linux-musl
cargo build --target i686-unknown-linux-musl
tech/notes_rust_lang_compilation.txt · Dernière modification : de Jean-Baptiste
