首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我收到一个错误:“找不到任务'C/C++:g++.exe构建活动文件‘

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

Stack Overflow用户
提问于 2022-02-03 07:07:07
回答 1查看 583关注 0票数 0

我已经尝试过堆栈溢出的大部分内容,包括处理外部控制台值、使用以前版本的C/C++扩展、将cppbuild更改为shell等。如果我无论如何按一下debug,我就会得到一个错误,说明启动程序'....launch.exe‘不存在。

这是我的launch.json:

代码语言:javascript
运行
复制
{
    // 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"
      }
    ]
  }

这是我的task.json:

代码语言:javascript
运行
复制
{
    // 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"
      }
    ]
  }
EN

回答 1

Stack Overflow用户

发布于 2022-08-18 03:11:04

"preLaunchTask":"C/C++:g++.exe构建活动文件“在launch.json中,应该与tasks.json中的”标签“:"C/C++:gcc.exe构建活动文件”保持一致。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70967102

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档