win安裝rust環境(mingw)


官網下載安裝文件
 
安裝mignw
 
修改系統環境變量
名稱 - 值
RUSTUP_DIST_SERVER : https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT : https://mirrors.ustc.edu.cn/rust-static/rustup
 
運行 init
提示沒有安裝編譯工具
選擇繼續
 
選擇2自定義
default host triple
x86_64-pc-windows-gnu
default toolchain
stable
modify PATH variable
yes
 
選擇1進行安裝
等待下載完成
 
.cargo/bin會自動添加到系統環境變量path中
手動把mignw的路徑也添加到系統環境變量path中
 
測試
rustup --version
rustup update
rustup show
 
F:\>cargo new hello
Created binary (application) `hello` package
 
F:\>cd hello
 
F:\hello>cargo run
Compiling hello v0.1.0 (F:\hello)
Finished dev [unoptimized + debuginfo] target(s) in 2.69s
Running `target\debug\hello.exe`
Hello, world!
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM