Rust 版本
安装Rust,具体到官网下载 https://www.rust-lang.org
我是在windows环境上,且我已经安装了Visual Studio 2019,所以可以省了安装MSVC,直接安装Rustup即可,安装版本如下:
cargo 1.49.0 (d00d64df9 2020-12-05)
用Cargo运行如下命令新建工程
PS D:\vstest\main> cargo new hello_cargo
Created binary (application) `hello_cargo` package
VSCode配置
安装三个插件
- Rust for Visual Studio Code
- rust-analyzer
- Native Debug
修改launch.json/* launch.json */
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name":"(Windows) Launch"
"type":"cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/hello_cargo.exe",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}