vs code 调试 c++ error

Unable to start debugging. Launch options string provided by the project system is invalid. “”(十六进制值 0x08)是无效的字符。 第 6 行

代码如下

 #include <stdio.h>
#include <stdlib.h>
int main(void){
    printf("hello, world\n");
    system("pause");
    return 0;
}

你可以看看下面这个链接

https://github.com/Microsoft/vscode-cpptools/issues/55

  • 方法就是在mingw的管理器里重新安装mingw-gdb

我也遇到了这个问题,经过检查发现,出现这个问题的原因是launch.json文件的配置有问题:
miDebuggerPath中的路径可能缺少“\”符号。
因为windows下的路径配置,在配置文件中需要两个\号进行分隔。
你可以试试。

launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/assembly/a.out",//.out文件位置
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

这程序没问题啊,要不你把程序截图看看。

图片说明
同问,参见截图,后面在linux下用了,没再试了