Skip to content

Instantly share code, notes, and snippets.

@MarioBinder
Last active April 14, 2021 19:08
Show Gist options
  • Save MarioBinder/9c1e7a753077e1b4f68b0971a305f5ab to your computer and use it in GitHub Desktop.
Save MarioBinder/9c1e7a753077e1b4f68b0971a305f5ab to your computer and use it in GitHub Desktop.
install_cplusplus_linux
# Develop C/C++ with VSCode on Linux
## Install MS Extension Pack:
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack
sudo apt install gcc
sudo apt-get update
sudo apt-get install build-essential gdb
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};
for (const string& word : msg)
{
cout << word << " ";
}
cout << endl;
}
{
// 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": "g++ - Aktive Datei erstellen und debuggen",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Automatische Strukturierung und Einrückung für \"gdb\" aktivieren",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++ Aktive Datei kompilieren",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ Aktive Datei kompilieren",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Vom Debugger generierte Aufgabe."
}
],
"version": "2.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment