๊ด€๋ฆฌ ๋ฉ”๋‰ด

IT’s Portfolio

[Mac] Rust ๊ฐœ๋ฐœํ™˜๊ฒฝ ๊ตฌ์ถ•(Visual Studio Code) ๋ณธ๋ฌธ

Development Study/Rust

[Mac] Rust ๊ฐœ๋ฐœํ™˜๊ฒฝ ๊ตฌ์ถ•(Visual Studio Code)

f1r3_r41n 2022. 7. 20. 13:24
728x90
๋ฐ˜์‘ํ˜•

๐Ÿ’ป ๋งฅ๋ถ ๋Ÿฌ์ŠคํŠธ ๊ฐœ๋ฐœํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ

ํŒŒ์ด์ฌ ๊ฐœ๋ฐœํ™˜๊ฒฝ์— ์ด์–ด ๋Ÿฌ์ŠคํŠธ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•ด๋ณด๋ ค ํ•œ๋‹ค.

๐Ÿ’ก Install Rust

curl์„ ์‚ฌ์šฉํ•ด ์„ค์น˜

  • cURL: command line ๋˜๋Š” script์—์„œ ๋ฐ์ดํ„ฐ ์ „์†ก์„ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

๐Ÿ’ก Start Rust

  • cargo new <directory_name>
    • ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด Rust ํ”„๋กœ์ ํŠธ ํด๋”๋ฅผ ์ƒ์„ฑํ•˜๋ฉด์„œ ํ•„์š”ํ•œ ์„ค์ • ํŒŒ์ผ ๋ฐ ๊ธฐ๋ณธ์ ์ธ Rust ์ฝ”๋“œ๊ฐ€ ํฌํ•จ๋œ ์†Œ์Šค์ฝ”๋“œ ํŒŒ์ผ์„ ์ƒ์„ฑ
    • Cargo.toml: ํ”„๋กœ์ ํŠธ ์„ค์ • ํŒŒ์ผ
    • src: Rust ์†Œ์Šค์ฝ”๋“œ ํฌํ•จ ๋””๋ ‰ํ„ฐ๋ฆฌ

๐Ÿ’ก Install Extensions for Rust

  • rust-analyzer, CodeLLDB ์„ค์น˜ํ•˜๊ธฐ
728x90
๋ฐ˜์‘ํ˜•
Comments