Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/132.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我的VSCode调试器dosen';不显示任何变量值(附图)(c+;+;) 我最近开始使用VSCode,似乎无法找出如何使用调试器。C++调试器没有显示任何可读的值。 我已经安装了微软的C++智能感知扩展。_C++_Debugging_Visual Studio Code - Fatal编程技术网

我的VSCode调试器dosen';不显示任何变量值(附图)(c+;+;) 我最近开始使用VSCode,似乎无法找出如何使用调试器。C++调试器没有显示任何可读的值。 我已经安装了微软的C++智能感知扩展。

我的VSCode调试器dosen';不显示任何变量值(附图)(c+;+;) 我最近开始使用VSCode,似乎无法找出如何使用调试器。C++调试器没有显示任何可读的值。 我已经安装了微软的C++智能感知扩展。,c++,debugging,visual-studio-code,C++,Debugging,Visual Studio Code,编辑: my launch.json: { "version": "0.2.0", "configurations": [ { "name": "g++.exe build and debug active file", "type": "cppdbg", "request": "launch&q

编辑:

my launch.json:

{
"version": "0.2.0",
"configurations": [

  {
    "name": "g++.exe build and debug active file",
    "type": "cppdbg",
    "request": "launch",
    "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
    "args": [],
    "stopAtEntry": true,
    "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": true
      }
    ],
    "preLaunchTask": "g++.exe build active file"
  }
]
}

my tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "g++.exe build active file",
            "command": "C:\\MinGW\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "C:\\MinGW\\bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "type": "shell",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\\MinGW\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

按照屏幕截图中@StupidMan的指示卸载了MinGW-w32并安装了MinGW-W64;此时(在第9行调试),msg尚未初始化,因此它没有要显示的值。。。尝试跳过。我在跳过后添加了一个图像,解决方案无法解决我的问题。我也有同样的问题。检查我最近的问题。你找到解决方案了吗?只需删除现有的MinGW,然后从这里安装MinGW-W64,它对我很有用。是的,非常感谢@StupidMan,我必须卸载我的MinGW-w32,并且必须按照你的指示安装MinGW-W64,我的调试器现在可以工作了