我安装了MinGW,并将配置添加到launch.json。
当我运行c ++代码时,它将在外部cmd中打开。我尝试设置
"externalConsole": true,
到"externalConsole": false,
,但是当我这样做时,代码将无法运行。
这是我正在使用的配置:
{
"name": "C/C++",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "build & debug file"
}