35
edits
Changes
→Launch: Nearly completed Launch Section
g++ -fdiagnostics-color=always -g helloworld.cpp -o ./helloworld
=== Launch ===
Our launch file will facilitate the execution of our code, in the '''task.json''' we compiled and produced an output, here we will run our code with the correct information.
# You can create a **launch.json** file by navigating to the '''RUN AND DEBUG: RUN''' section on the left side navigator, (or use '''Command+Shift+D''')
# You’ll see an option there that says “'''To customize your Run and Debug create a launch.json file'''”. Choose this option, it will allow us to pass arguments into our code.
# This will create a JSON file called '''launch.json''' inside the '''.vscode folder''' from before. It will look something like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: [https://go.microsoft.com/fwlink/?linkid=830387](https://go.microsoft.com/fwlink/?linkid=830387)
"version": "0.2.0",
"configurations": []
}
<li value="4"> Find and press the “'''Add configurations'''" button near the bottom right, it will let add a template configuration for us to start with </li>
:i. You’ll see many options come up, we want to choose “'''C/C++: (lldb) Launch'''”.Now our launch.json should look like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch", // Name of our configuration
"type": "cppdbg", // Type of Launch (This type is as C++ Debugger)
"request": "launch", // We are requesting to launch our code
"program": "enter program name, for example ${workspaceFolder}/a.out", // Here is where we will add the name of our file
"args": [], // All arguments we want to use
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}
]
}
=== OpenMP ===
OpenMP