vscode c++ 环境配置
完整教程请查看该教程:https://blog.csdn.net/qq_43041976/article/details/100542557
使用MinGW-W64 GCC-8.1.0编译器默认安装目录的配置文件
MinGW-W64 GCC下载地址:https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
离线下载地址:https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/
如果您使用的Vscode版本过老,以下文件中的"${workspaceFolder}"
可能需要替换为"${workspaceRoot}"
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示
"type": "cppdbg", // 配置类型,这里只能为cppdbg
"request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加)
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", // 将要进行调试的程序的路径
"args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可
"stopAtEntry": false, // 设为true时程序将暂停在程序入口处,一般设置为false
"cwd": "${workspaceFolder}", // 调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录 workspaceRoot已被弃用,现改为workspaceFolder
"environment": []