Zum Hauptinhalt springen
ProdukteDesktop-WerkzeugeTASTECADZeichnungsprüfungTASTEFILESDateiverwaltungTASTEFTPDateiübertragungTASTESSHRemote-ArbeitsbereichTASTEZIPKomprimieren und EntpackenTASTEWINMDateiverwaltungEntwicklerwerkzeugeTASTECODEIntegrierte Entwicklungsumgebung für RustTASTESTUDIOIntegrierte Entwicklungs- und TestumgebungTASTEETLDatenintegration (ETL)ServerTASTEREMOTERemote-Desktop-ServerTASTEGEOGeodatenserverTASTEMAILE-Mail-ArbeitsbereichInvestierenTASTESTOCKDesktop-App für automatischen AktienhandelErste SchritteDownloadsDokumentationKaufenAlle Produkte
Marktplatz
Neuigkeiten
TechnikNeuigkeitenEntwickler-News von heuteEntwicklerdokuProgrammiersprachenRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp- & Desktop-FrameworksTauriFlutterReact NativeElectronAlgorithmenAlgorithmus-GrundlagenKernalgorithmenFortgeschrittene AlgorithmenAlgorithmen für die Praxis
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcaseCommunity-Leitfaden
ZusammenarbeitWissenstransferWebsite-AufbauDesktop-App-AufbauRelease- und ZahlungspipelineVertriebspartnerKontakt
DiensteRemote-DesktopIndividuelle Installationspakete
TASTEDEV
Produkte

Desktop-Werkzeuge

TASTECADKomplexe Zeichnungen, mühelos geöffnetTASTEFILESNur die Dateien, die zählen – in BestzeitTASTEFTPDer aufgeräumteste Weg für Ihre DateienTASTESSHDie stärkere Verbindung zu Ihren ServernTASTEZIPSchneller packen, sicherer entpackenTASTEWINMEin tastaturorientierter Dateimanager mit zwei Fenstern

Entwicklerwerkzeuge

TASTECODERust-Apps bearbeiten, bauen, debuggen und testen – alles in einem FensterTASTESTUDIOVom Bearbeiten bis zu Remote-Tests und freigegebenen KI-KorrekturenTASTEETLDaten bewegen, die Werte im Blick

Server

TASTEREMOTEEin Remote-Desktop auf Ihrem eigenen ServerTASTEGEOEin GeoServer-kompatibler Geodatenserver, neu aufgebaut in RustTASTEMAILIhre E-Mail wieder in Ihrer Hand

Investieren

TASTESTOCKAutomatischer Aktienhandel nach Ihren Regeln: wann und was

Erste Schritte

DownloadsNeueste Versionen aller ProdukteDokuSo nutzen Sie jedes ProduktKaufenAbos und DauerlizenzenAlle ProdukteAlle Produkte im Überblick
Alle Produkte
MarktplatzNeuigkeiten
Technik

Neuigkeiten

Entwickler-News von heuteOffizielle Meldungen zu Sprachen, Frameworks, GitHub und KIEntwicklerdokuAnleitungen zu Sprachen, Frameworks und Algorithmen

Programmiersprachen

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web-Frontend-FrameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server-FrameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App- & Desktop-FrameworksTauriFlutterReact NativeElectron

Algorithmen

Algorithmus-GrundlagenKomplexitätsanalyse · Sortieren · Suchen · Grundlegende Datenstrukturen · Bäume und HeapsKernalgorithmenGraphtraversierung · Kürzeste Wege und minimale Spannbäume · Dynamische Programmierung · Greedy-Algorithmen · Teile und herrsche · BacktrackingFortgeschrittene AlgorithmenZeichenkettenalgorithmen · Mathematik und Zahlentheorie · Bitmanipulation · Segmentbäume · Union-FindAlgorithmen für die PraxisStrategie für Coding-Interviews · LRU-Cache · Rate Limiting · Konsistentes Hashing
Alle Entwicklungsdokumente
Community
ProjekteEntwickler und Projekte entdeckenEntwicklungslogsEntscheidungen und ErkenntnissePromptsWiederverwendbare AnweisungenProbleme mit KI-ToolsProbleme und Workarounds für Claude, Codex, GeminiShowcaseFertige ErgebnisseCommunity-LeitfadenWie wir offen entwickeln
Zusammenarbeit
WissenstransferNative Apps mit Rust und eguiWebsite-Aufbau10 Sprachen, Konten, Dokumentation und DownloadsDesktop-App-AufbauRust und egui, ohne WebViewRelease- und ZahlungspipelineSignatur, MSI, deb, rpm, AppImage, PrüfsummenVertriebspartnerEmpfehlen und 30 % erhaltenKontaktEntwicklung, Partnerschaft, Investition
Dienste
Remote-DesktopIhren Computer im Browser erreichenIndividuelle InstallationspaketeNur nötige Funktionen, Einstellungen vorab
Kaufen
DE
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Anmelden
Anmelden
TASTEDEV

Von kleinen Werkzeugen zu besserer Entwicklung.

support@tastedev.netTASTEDEV unterstützen
ProdukteProduktübersichtKaufenDokuDownloadsMarktplatzSupport
CommunityProjekteEntwicklungslogsPromptsProbleme mit KI-ToolsShowcase
RichtlinienÜber unsDatenschutzerklärungNutzungsbedingungenAbo-BedingungenRückerstattungCommunity-Richtlinien
KontoAnmeldenRegistrieren
Besucher
Heute
Gestern
Aufrufe gesamt
Firma
GXSOFT
Vertretungsberechtigt
CHOI YOUNG GU
Handelsregisternummer
853-44-00368
Anschrift
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefon
+82-10-4404-1523
E-Mail
whitecalvin@tastedev.net
Datenschutzbeauftragter
CHOI YOUNG GU

© 2026 TASTEDEVProduktinformationen basieren auf verifizierten Entwicklungsquellen.Veröffentlicht · wird verbessert

C++-Dokumentation
C++
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
Diskussionen

C++-Anleitung · 1/6

Getting Started

Dieses Kapitel ist vorerst nur auf Englisch verfügbar.

C++ is a compiled language: you don't run a source file directly. A compiler translates it into object code, a linker combines the pieces into an executable, and then you run that executable. This chapter walks through installing a toolchain, building your first program, picking a language standard, turning on warnings, and setting up a minimal CMake project.

Installing a compiler

There are three major compilers, and which one you reach for usually depends on your platform.

CompilerTypical platformHow to get it
GCC (g++)Linux, Windows via MinGW-w64Your distribution's package manager
Clang (clang++)macOS, Linux, WindowsXcode Command Line Tools or a package manager
MSVC (cl)WindowsVisual Studio or Build Tools with the "Desktop development with C++" workload

On Linux and macOS, one command is usually enough:

# Debian / Ubuntu: g++, make and friends
sudo apt install build-essential

# Fedora
sudo dnf install gcc-c++

# macOS: clang++ plus the basic developer tools
xcode-select --install

# Check what you got
g++ --version
clang++ --version

For MSVC, install the C++ workload from the Visual Studio Installer, then open Developer Command Prompt or Developer PowerShell from the Start menu. Those shells are preconfigured so that cl and its libraries are on the path; an ordinary terminal won't find them.

Your first program

Save the following as hello.cpp:

#include <iostream>

int main() {
    std::cout << "Hello, C++!\n";
    return 0;
}

The #include <iostream> line pulls in the declarations for the standard I/O streams. Execution begins in main, and returning 0 tells the operating system that everything went fine. std::cout is the standard output stream; the << operator pushes values into it.

Compiling and running

# GCC
g++ -std=c++20 -Wall -Wextra -o hello hello.cpp
./hello

# Clang
clang++ -std=c++20 -Wall -Wextra -o hello hello.cpp
./hello

MSVC spells its options differently:

cl /std:c++20 /EHsc /W4 hello.cpp
hello.exe

/EHsc selects standard C++ exception handling. You will want it on practically any program that uses the standard library.

Picking a language standard

Fragen zu diesem Kapitel?
Nächstes KapitelSyntax Basics

A new ISO C++ standard ships roughly every three years. C++11 was the big modernization, followed by C++14, C++17, C++20 and C++23. Compilers don't all default to the same one, so it pays to state the version explicitly.

  • -std=c++17 gives you structured bindings, std::optional, std::filesystem and more.
  • -std=c++20 adds concepts, ranges, std::format and modules. It is a sensible baseline for new code.
  • -std=c++23 brings std::expected, std::print and other additions. Check how far your compiler and standard library have implemented it before relying on it.

GCC and Clang also accept -std=gnu++20, which enables GNU extensions on top. If portability matters, stick with -std=c++20.

Turn the warnings on

Out of the box, C++ compilers stay quiet about a lot of suspicious code. With warnings enabled they will point out uninitialized variables, comparisons between signed and unsigned integers, unused variables and plenty more.

  • GCC and Clang: use -Wall -Wextra -Wpedantic as a baseline, and add -Werror if you want warnings to fail the build.
  • MSVC: use /W4, plus /WX to treat warnings as errors.
  • Add -g (or /Zi on MSVC) for debug information, and -O2 (or /O2) for optimized release builds.

A minimal CMake project

Typing compiler commands by hand stops being fun after a couple of files. CMake is the de facto standard build configuration tool for C++: it reads a CMakeLists.txt and generates project files for a real build system such as Ninja, Make or Visual Studio.

cmake_minimum_required(VERSION 3.20)
project(hello LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_executable(hello hello.cpp)

if(MSVC)
  target_compile_options(hello PRIVATE /W4)
else()
  target_compile_options(hello PRIVATE -Wall -Wextra -Wpedantic)
endif()

Put this file next to hello.cpp and build out of source, so generated files never mix with your code:

cmake -S . -B build
cmake --build build
./build/hello

With the Visual Studio generator the executable lands in a per-configuration folder such as build/Debug/hello.exe. Visual Studio, VS Code with the CMake Tools extension, and CLion can all open a CMakeLists.txt directly as a project.

Summary

  • C++ programs are built with a compiler (GCC, Clang or MSVC) before they run.
  • Always pick a standard explicitly, for example -std=c++20, and enable warnings with -Wall -Wextra or /W4.
  • One-line compiler commands are fine for experiments; use CMake for anything real.
  • Next up: variables, functions and control flow.

0 Kommentare

Top-KommentareNeueste zuerst

Anmelden · Melde dich an, um einen Kommentar zu schreiben.