首页 > 解决方案 > 我无法在 Visual Studio 代码中使用“开始调试”选项

问题描述

我是编码领域的菜鸟,这是我第一次希望尝试正确地对堆栈溢出提出问题。

它总是要求配置 launch.json 但添加任何配置并没有解决我的问题。我的 launch.json 现在看起来像这样:-

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "enter program name, for example ${workspaceFolder}/a.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ]``
    }
  
]}

每当直接从 launch.json 构建它时,我都会收到此消息错误:-

 "launch:program 'enter program name, for example /home/prabhav/Documents/a.out' does not exist.

这些是添加配置的一些选项

标签: c++cjsongccvisual-studio-code

解决方案


推荐阅读