Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tasks.json] The specified task cannot be tracked #2884

Closed
mxdh opened this issue Dec 1, 2018 · 7 comments
Closed

[Tasks.json] The specified task cannot be tracked #2884

mxdh opened this issue Dec 1, 2018 · 7 comments
Labels

Comments

@mxdh
Copy link

mxdh commented Dec 1, 2018

Type: Debugger

Describe the bug

  • OS and Version:Win10 1809
  • VS Code Version:1.29.1
  • C/C++ Extension Version:0.20.1
  • Other extensions you installed (and if the issue persists after disabling them):Problem persists after disabling all (and leaving C/C++):
    Code Runner
    cppcheck
    Include Autocomplete
    Markdown All in One
    Pascal
    vscode-luogu

To Reproduce
Steps to reproduce the behavior:
Sorry,my English is not good.

After I updated the VSCode and the OS,when I run the debugger, it throws this exception:
tim 20181124120332

Additional context
my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "cmd",
            "args": [
                "/c",
                "${file}/../${fileBasenameNoExtension}.exe",
                "&echo.",
                "&pause"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "preLaunchTask": "gcc",
        },
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${file}/../${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "D:/Compiler/MinGW/bin/gdb.exe",
            "preLaunchTask": "gccdbg",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

my task.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "gccdbg",
            "type": "shell",
            "command": "gcc",
            "args": [
                "-std=c++98",
                "-g",
                "-Wall",
                "-Wextra",
                "-v",
                "-H",
                "${relativeFile}",
                "-o",
                "${relativeFile}/../${fileBasenameNoExtension}.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
                }
            }
        },
        {
            "label": "gcc",
            "type": "shell",
            "command": "gcc",
            "args": [
                "-std=c++98",
                "-Wall",
                "-Wextra",
                "${relativeFile}",
                "-o",
                "${relativeFile}/../${fileBasenameNoExtension}.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
                }
            }
        }
    ]
}
@bytemain
Copy link

bytemain commented Dec 1, 2018

I have succeeded with this link.
VS Code 搭建 C/C++ 编译运行环境的三种方案

@pieandcakes
Copy link
Contributor

This seems like an issue with your task and not debugging. Can you try and run your task from the Command field in VS Code and see if it runs successfully by itself?

@mxdh
Copy link
Author

mxdh commented Dec 3, 2018

@pieandcakes This problem has appeared since I updated the VSCode and the OS

@pieandcakes
Copy link
Contributor

@a2757326588 Tasks.json is not managed by the extension, but by VS Code itself. Their issues page can be found here. I think they will ask you the same questions though to determine what is causing the problem.

@pieandcakes pieandcakes changed the title The specified task cannot be tracked [Tasks.json] The specified task cannot be tracked Dec 3, 2018
@mxdh
Copy link
Author

mxdh commented Dec 4, 2018

@pieandcakes They told me that this issue caused by the extension.
microsoft/vscode#63705

@pieandcakes
Copy link
Contributor

I commented on that thread to get more information.

cc: @WardenGnaw

@mxdh
Copy link
Author

mxdh commented Dec 13, 2018

Thank you.
This problem has been fixed.

@mxdh mxdh closed this as completed Dec 13, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants