Answer the question
In order to leave comments, you need to log in
How to write task.json to compile C++ file?
Hello.
Please tell me where I have an error
wrote a simple code on cpp
#include <iostream>
using namespace std;
int main() {
//setlocale(LC_ALL, "");
int ans, x, y;
bool f;
std::cout << "hello!" << endl;
cout <<" -------------------------" << endl;
return 0;
}
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"preLaunchTask": "mybuild",
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "mybuild",
"type": "shell",
"command": "g++",
"args": [
"${file}",
"-g"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "always"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
Invalid parameter format: /d
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question