WSL+VSC 搭建C C++开发环境

1. 安装WSL

2. 配置WSL 软件, 安装所需工具

sudo apt-get install build-essential gcc g++  gdb

3. Windows 下安装VSC

4. VSC 配置

4.1.安装C/C++ 扩展插件

必须:C/C++:又名 cpptools,提供Debug和Format功能

可选:

  • Code Runner:右键即可编译运行单文件,很方便;但无法Debug

  • Bracket Pair Colorizer 2:彩虹花括号

  • One Dark Pro:大概是VS Code安装量最高的主题

  • C/C++ Snippets:Snippets即重用代码块,效果自己百度;这个扩展安装量虽高,不过个人感觉用处实在不大,cpptools和clangd也自带一些;你也可以选择其他的Snippets扩展甚至自定义

4.2. 安装远程开发包 Remote Development 扩展插件

可以在VSC 扩展中找到 Remote Development,也可以从如下地址中找到,名字: Visual Studio Code Remote Development Extension Pack

地址:https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack

4.3. 安装 Visual Studio IntelliCode

4.4. 安装Code Spell Checker

5. WSL 启动VSC

在需要启动的目录下运行

code .

首次从WSL 打开VSC 自动安装一些插件,等待安装完成。之后就可以正常使用了

Windows 下命令行工具校验MD5, SHA1, SHA256

使用Windows 10/11 自带工具 certuil 可以校验文件的 MD5, SHA1, SHA256,SHA512 等的哈希值。
cmd调出命令行,输入如下命令

certuil --hashfile <file_name> <hash_type>

例如:

certuil --hashfile win10.iso MD5
certuil --hashfile win10.iso SHA256

实际使用

PS D:\Downloads>  certutil -hashfile .\veket-2.0.6.iso MD5
MD5 的 .\veket-2.0.6.iso 哈希:
a5bcf7d8ac8035638227a7e7499f2d01
CertUtil: -hashfile 命令成功完成。