繁体   English   中英

我收到一条错误消息“找不到任务'C/C++:g++.exe 构建活动文件'

[英]I get an error saying " Could not find the task 'C/C++: g++.exe build active file'

我已经在 Stack Overflow 上尝试过大多数事情,包括搞乱外部控制台值、使用以前版本的 C/C++ 扩展、将 cppbuild 更改为 shell 等。似乎没有任何效果。 如果我仍然按调试,我会收到一条错误消息,指出启动程序“....launch.exe”不存在。

这是我的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": "g++.exe - Build and debug active file",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "C:\\msys64\\mingw64\\bin",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ],
        "preLaunchTask": "C/C++: g++.exe build active file",
        "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe"
      }
    ]
  }

这是我的任务。json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
      {
        "type": "shell",
        "label": "C/C++: gcc.exe build active file",
        "command": "C:\\msys64\\mingw64\\bin\\gcc.exe",
        "args": [
          "-fdiagnostics-color=always",
          "-g",
          "${file}",
          "-o",
          "${fileDirname}\\${fileBasenameNoExtension}.exe"
        ],
        "options": {
          "cwd": "${workspaceFolder}"
        },
        "problemMatcher": [
          "$gcc"
        ],
        "group": {
          "kind": "build",
          "isDefault": true
        },
        "detail": "compiler: C:\\msys64\\mingw64\\bin\\gcc.exe"
      },
      {
        "label": "run make",
        "type": "shell",
        "command": "make"
      },
      {
        "label": "run make test",
        "type": "shell",
        "command": "make test"
      }
    ]
  }

"preLaunchTask": "C/C++: g++.exe build active file" in launch.json, should be consistent with "label": "C/C++: gcc.exe build active file" in tasks.json.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM