https://www.rust-lang.org/tools/install
https://code.visualstudio.com/download
这个插件比rust要更好用一些
https://rust-analyzer.github.io/
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
如果不安装,后面在编译时,会报错说”link.exe”无法找到
https://visualstudio.microsoft.com/downloads/#other
All Downloads ->Build Tools for Visual Studio 2019->download 下载安装包
运行安装包打开的visual studio 安装工具中选择 c++ 生成工具完成安装
https://www.rust-lang.org/tools/install
https://code.visualstudio.com/download
首先从源码安装rust-analyzer
$ rustup component add rust-src
# clone the repo
$ git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer
# install both the language server and VS Code extension
$ cargo xtask install
或者下载二进制文件后在vscode中配置下路径
{ “rust-analyzer.server.path”: “~/.local/bin/rust-analyzer-linux” }
这个插件比rust要更好用一些
https://rust-analyzer.github.io/
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
Click Debug
-> Add Configuration
If you’re on Windows then select C++ (Windows)
If you’re on Mac or Linux then select LLDB: Custom Launch
This should create and open launch.json. You’ll have to manually change the executable name under “program”.
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/target/debug/foo.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true
},
{
"name": "(OSX) Launch",
"type": "lldb",
"request": "launch",
"program": "${workspaceRoot}/target/debug/foo",
"args": [],
"cwd": "${workspaceRoot}",
}
]
}
默认rust的文件无法打断点,需要使能下面的配置
File -> Preferences -> Settings 设置 “debug.showInlineBreakpointCandidates”: true
https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/
https://code.visualstudio.com/docs/cpp/config-msvc
https://skyao.io/learning-rust/installation/windows.html
https://rust-analyzer.github.io/manual.html#installation