# Windows, macOS, Linux 설치 명령어
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shrustc --version
cargo --versionrustup update// main.rs
fn main() {
println!("Hello, World!");
}rustc main.rs
./main # Linux/macOS
.\main.exe # Windows새 프로젝트 생성
cargo new hello_cargo
cd hello_cargo
Cargo.toml 구성 예시
[package]
name = "hello_cargo"
version = "0.1.0"
edition = "2021"
[dependencies]
프로젝트 빌드 및 실행
cargo build # 빌드
cargo run # 빌드 및 실행
cargo check # 컴파일 체크만 수행
릴리즈 빌드
cargo build --release # 최적화된 릴리즈 버전 빌드
rustup doc참조: https://doc.rust-lang.org/book/ch01-00-getting-started.html