网站只做静态页面安全受到影响,没有地址如何注册公司,网页搜索功能,网站顶部flash一、下载
到官网https://www.rust-lang.org/zh-CN/tools/install下载你需要的版本 二、安装
执行rustup-init 文件#xff0c;选择1 按提示直到安装完成
可以通过以下命令测试#xff1a;
rustc -V # 注意的大写的 V
cargo -V # 注意的大写的 V三、在VScode中…一、下载
到官网https://www.rust-lang.org/zh-CN/tools/install下载你需要的版本 二、安装
执行rustup-init 文件选择1 按提示直到安装完成
可以通过以下命令测试
rustc -V # 注意的大写的 V
cargo -V # 注意的大写的 V三、在VScode中调试
创建.vscode文件夹目录结构如下
并依次创建tasks.json
{version: 2.0.0,tasks: [{label: build,type: shell,command: cargo,args: [build]}]
}和launch.json
{version: 0.2.0,configurations: [{name: (Windows)启动,preLaunchTask: build,type: cppvsdbg,request: launch,program: ${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe,args: [],stopAtEntry: false,cwd: ${workspaceFolder},environment: [],externalConsole: false},{name: (gdb)启动,type: cppdbg,request: launch,program: ${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe,args: [],stopAtEntry: false,cwd: ${workspaceFolder},environment: [],externalConsole: false,MIMode: gdb,miDebuggerPath: C:\\Program Files\\MinGW-w64\\bin\\gdb.exe,setupCommands: [{description: 为gdb启用整齐打印,text: -enable-pretty-printing,ignoreFailures: true}]}]
}正常返回src下的main.rs写入以下代码
fn main() {println!(Hello, world!);
}然后点击 VSCode 左栏的 运行或者在main.rs中按F5。
3.1 (Windows) 启动
如果你使用的是 MSVC 选择 “(Windows) 启动”它会跳到终端显示执行情况 要手动切换到调试控制台看结果 打断点有效 如果弹出cppvsdbg不受支持请先安装以下扩展 修改代码后执行此调试方式会重新构建代码生效
3.2 (gdb) 启动
如果使用的是 MinGW 且安装了 GDB 选择(gdb)启动gdb 启动前请注意填写 launch.json 中的 “miDebuggerPath”。 先下载MinGW64 8.1 (https://www.onlinedown.net/soft/10045442.htm)到电脑上解压后路径填到launch.json 中的miDebuggerPath。
按F5后直接在终端看结果。 打断点无效
修改代码后执行此调试方式不会重新构建代码不生效