vscode-cpptools
vscode-cpptools copied to clipboard
Cannot build and debug because the active file is not a C or C++ source file.
Trying to setup VScode on my new laptop. I'm new to C and coding but I set it up the exact way I did on my other laptop but I got this error: "Cannot build and debug because the active file is not a C or C++ source file."
tasks.json: { "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: gcc.exe build active file", "command": "C:/mingw64/bin/gcc.exe", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}\${fileBasenameNoExtension}.exe", "" ], "options": { "cwd": "C:/mingw64/bin" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: C:/mingw64/bin/gcc.exe" } ] }
Anyone got any idea how to approach this? Thanks in advance
Maybe that's because the extension name of the file is not c nor cpp.
Maybe that's because the extension name of the file is not c nor cpp.
All files are in the .c format
@aranis22 Which file do you have open (that is currently active) when you start build and debug?
Do you have the setting files.associations configured?
Example:
"files.associations": {
"*.c": "cpp"
}
This issue has been closed because it needs more information and has not had recent activity.