Last active
April 14, 2021 19:08
-
-
Save MarioBinder/9c1e7a753077e1b4f68b0971a305f5ab to your computer and use it in GitHub Desktop.
install_cplusplus_linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// 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" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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