[1. 개요]
Rust code 컴파일 방법에 대해서 정리하도록 한다.
[2. rustc]
rustc 는 러스트 소스코드에 대한 컴파일러 이다.
소스코드에 대해서 라이브러리 뿐만 아니라 실행파일 까지 컴파일이 가능하다.
보통은 rustc 를 직접 사용하여 컴파일 하지 않고,
cargo 등을 이용해서 간접적으로 사용하게 된다.
[3. 예제 - 1]
hello world 출력
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
println!("Hello world"); | |
} | |
/* | |
# how to build | |
$ rustc ch1.rs | |
$ ./ch1 | |
# output | |
Hello world | |
*/ |
'Rust > 예제 및 개념' 카테고리의 다른 글
Rust. 변수 (0) | 2023.10.12 |
---|---|
Rust. Cargo 개념 및 사용 방법 (0) | 2023.10.10 |