Reputation: 1
I'm having an issue with launch.json. when i download vscode. then i run(press f5 for debug) any code file , file doesn't running ... its showing like vscode came without launch.json,task.json, setting.json.. after that i copied the launch.json from githib.. its showing error(given in picture) when I run any file of js (javascript) .
and tried to work on c++ on vscode with MingW, but vscode doesn't worked with MingW.... when i run file of c++ in vscode terminal and showing thi error : enter image description here
Upvotes: 0
Views: 945
Reputation: 1455
Your launch file is for java script code and not for C/C++.
Please follow the instructions on Microsoft's site for VS Code:
https://code.visualstudio.com/docs/cpp/config-msvc
or in your case:
https://code.visualstudio.com/docs/cpp/config-mingw
Your launch.json file should look something like this:
{
"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": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Upvotes: 1