FlyingDullPig 2018-12-04 05:18 采纳率: 0%
浏览 4920

VS code C语言调试提示:lanch:program‘E:\develop\Visual Stodio Code\a.exe'does not exit

大佬们:刚装的环境 学习C语言 代码示例调试时提示:lanch:program‘E:\develop\Visual Stodio Code\a.exe'does not exit。调了半天,请大佬们指出问题在哪?

程序代码

 #include <stdio.h>
int g_var=0;
void print_line(char *str)
{
    if(str!=NULL)
    printf("%s\r\n",str);
    else
    printf("null string\r\n");
      }
    int main(int argc, char const *argv[])
    {
        int l_var=1;
        print_line("hello world");
        printf("g_var=%d,l_var=%d.\r\n",g_var,l_var);
        return 0;
    }

takks.json

 {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "command": "gcc",
    "args": [
        "-g",
        "${file}",
        "-o",
        "${workspaceRoot}/hello.exe"
    ],
    "problemMatcher": {
        "owner": "cpp",
        "fileLocation": ["relative", "${workspaceRoot}"],
        "pattern": {
            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "severity": 4,
            "message": 5
        }    
    }
    }

lanuch.json

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

1条回答

  • shellta 2018-12-04 08:42
    关注

    可能是win10自带的windows defender将编译器生成的文件当成病毒自动处理了。可以去通知中心看一下

    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮