简体   繁体   English

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

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

I've tried most things on Stack Overflow including messing around with external console values, using a previous version of C/C++ extensions, changing cppbuild to shell, etc. Nothing seems to make it work.我已经在 Stack Overflow 上尝试过大多数事情,包括搞乱外部控制台值、使用以前版本的 C/C++ 扩展、将 cppbuild 更改为 shell 等。似乎没有任何效果。 If I press debug anyway, I get an error saying the launch program '....launch.exe' does not exist.如果我仍然按调试,我会收到一条错误消息,指出启动程序“....launch.exe”不存在。

Here is my launch.json:这是我的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"
      }
    ]
  }

Here is my task.json:这是我的任务。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. "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.

相关问题 找不到任务“C/C++:gcc 构建活动文件” - Could not find the task 'C/C++: gcc build active file' 如何解决“找不到任务 C/C++:gcc 构建活动文件”。 VSCode 中的错误? - How do I fix “Could not find the task C/C++: gcc build active file.” error in VSCode? 如何修复错误:g++.exe:无法使用 -c 或 -S 指定 -o 和多次编译 - How to fix error : g++.exe : cannot specify -o with -c or -S and multiple compilations 如何解决“找不到任务'gcc build active file”。 VSCode 中的错误? - How to solve “Could not find the task 'gcc build active file.” error in VSCode? 当我调试一个 C 程序时,我遇到了这个错误:PreLaunchTask 'C/C++:gcc.exe build active file' terminate with exit code -1 - when I debug a C program , I meet this mistake:The preLaunchTask 'C/C++:gcc.exe build active file' terminated with exit code -1 C/C++ VS 代码扩展引发构建错误:““C/C++”任务的任务提供程序意外提供了“shell”类型的任务。” - C/C++ VS Code extension throwing build error: “The task provider for ”C/C++“ tasks unexpectedly provided a task of type ”shell“.” 如何识别exe文件是c还是c++? - How to identify an exe file is in c or c++? 我无法解决此问题 [错误] 'rand' 未在开发 c++ 的此 scope 中声明 - i could not solve this [Error] 'rand' was not declared in this scope in dev c++ 是不是说“C / C ++”错了? - Isn't saying “C/C++” wrong? C-运行我编译的.exe文件时出错 - C - Error while running .exe file that I compiled
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM