35
edits
Changes
→Tasks: Completed Tasks Section
# This will create a folder called '''.vscode''' with a JSON file called: '''tasks.json'''
# Open the '''tasks.json''' file, it should look like this:
{
"tasks": [
{
"type": "cppbuild", // Type of task
"label": "C/C++: g++ build active file", // Label for the task This is important!! for our launch file
"command": "/usr/bin/g++", // Which command will be used
"args": [ // All the arguments that will be used at buildtime
"-fdiagnostics-color=always", // Use Diagnostic colors
"-g", // Create debugger data to be used
"${file}", // Compile this file
"-o", // Output it as
"${fileDirname}/${fileBasenameNoExtension}" // The File name without the .cpp extension
],
"options": {
"cwd": "${fileDirname}" // The working directory that we'll run our compiler in
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
This task tells VScode, when we use this task, run [this].command with [this].args. VScode will inject this into our terminal to automatically compile our code. This will help our VScode Debugger and help our launch task get ready for running our code.
g++ -fdiagnostics-color=always -g helloworld.cpp -o ./helloworld
=== OpenMP ===
OpenMP