vscode安装
https://blog.csdn.net/abilix_tony/article/details/123422270
遇到的坑:(mlgb 神坑)
解决vscode编译器报错g++.exe: error: unrecognized command line option ‘--interpreter=mi‘
天为vscode搭建C++环境时最后报错
Starting: "C:\MinGW\bin\g++.exe" --interpreter=mi
g++.exe: error: unrecognized command line option '--interpreter=mi'
g++.exe: fatal error: no input files
compilation terminated.
"C:\MinGW\bin\g++.exe" exited with code 1 (0x1).
看一下配置文件
{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "gcc.exe - 生成和调试活动文件", "type": "cppdbg", "request": "launch", "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "D:\\D\\GoogleDownload\\MinGW\\bin\\gdb.exe", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true }, { "description": "将反汇编风格设置为 Intel", "text": "-gdb-set disassembly-flavor intel", "ignoreFailures": true } ], "preLaunchTask": "C/C++: gcc.exe 生成活动文件", } ] }
将C:\MinGW\bin\g++.exe路径改为
C:\MinGW\bin\gdb.exe即可