Skip to content

Cannot build and debug because the active file is not a C or C++ source file. #8586

Closed
@Kemal321

Description

@Kemal321

I start to use VS Code. I followed "https://code.visualstudio.com/docs/cpp/config-mingw" but when I choose Ctrl+Shift+B or from the Terminal main menu Run Build Task. I take error . " Cannot build and debug because the active file is not a C or C++ source file.
The terminal process failed to launch (exit code: -1). "
My task.json config.
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: g++.exe build active file", "command": "C:\\msys64\\mingw64\\bin\\g++.exe", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: C:\\msys64\\mingw64\\bin\\g++.exe" } ] }

Metadata

Metadata

Assignees

Labels

Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.tasks/build/debugAn issue relating to tasks.json (e.g. build issues)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions