vscode的这个情况该怎么解决

img

img

img

准备工作:

  1. vs code安装插件:cpptools
  2. windows安装MinGW,然后配置MinGW,需要的工具有gcc,g++,gdb,最后将MinGW的路径添加到path系统环境变量

使用ctrl+shift+p调出命令对话框,输入:task,选择:configure task runner,继续选择:others,即可产生tasks.json文件,改为如下内容:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gcc",
"isShellCommand": true,
"args": ["-g", "${file}", "-o", "${file}.exe"],
"showOutput": "always"
}

  1. 配置launch.json文件
    切换到test.c页面,按下F5,在“选择环境”对话框中输入GDB,即选择“C++ (GDB/LLDB)”,产生launch.json文件

将“program”的值改为:

"program": "${file}.exe",
顺便在下面加上一行:

"miDebuggerPath": "C:\MinGW\bin\gdb.exe",
这里的miDebuggerPath即为gdb的安装路径。

按F5即可开始调试

Ctrl + Shift + P,Remove All Breakpoints

把断点和错误移除试试:

img


希望对题主有所帮助,望采纳!!

错误提示为,本地dll文件加载出问题,你之前是设置了什么吗

最后那个爆红的处理一下,检查一下编译器的路径是否放置正确