Rob*_*art 7 c++ visual-studio-code
我在 ubuntu 上用 Visual Studio 代码创建了一个 C++ 项目。它使用 gdb 模式启动程序,但在输出中不显示任何内容。当我从控制台启动程序时,输出存在。我尝试插入“控制台”属性,但 vscode 告诉我,它是被禁止的(来自节点https://github.com/Microsoft/vscode/issues/30842 的类似问题)。
如何启用 vscode 来显示我的程序的输出?
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
你的配置是正确的。程序输出应该在DEBUG CONSOLE中。
菜单| 调试控制台或Ctrl+Shift+Y。
| 归档时间: |
|
| 查看次数: |
23357 次 |
| 最近记录: |