本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

C++ ドキュメント
C++
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
ディスカッション

C++ ガイド · 1/6

Getting Started

この章は現在、英語でのみ提供しています。

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

この章について質問がありますか?
次の章Syntax 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件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。