microsoft / microsoft/vscode-cpptools

Compile and Debug error on GCC + VSCode

Open
#13,088 0 comments 0 reactions 1 assignee View on GitHub

@browntarik is already working on this.

Since Jan 2, 2025.

investigate: repro Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Win11
  • VS Code: 1.96.2
  • Used Msys2 from VSCode documentation page (on 30/12/2024)
  • C/C++ extension: GCC 14.2.0
  • GDB / LLDB version: 15.2
Bug Summary and Steps to Reproduce

Hi there, I've just installed msys2 with gcc, g++ and gdb to compile and debug C files, I can compile it using gcc [file_path] -o [output], but when I click on Run or Debug using VSCode, it shows me that the file doesn't exist. I've already checked if there's any application running on task manager, nothing running, also, tried to configure a launch.json file, but it didn't work, the same error appears everytime, so, how do I fix this, or even, how can I disable debugging? So it can just compile for me, and then I debug it externally.

Image
Image
Image

If there's any information missing, just let me know and I update it here :D

Debugger Configurations
{
    "tasks": [
        {
            "type": "cppbuild",
            "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": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}
Debugger Logs
No logs are generated apart vscode console logs.
Other Extensions

N/A

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.