C++ Tools Ecosystem C++ Tools Ecosystem C++ Tools

    Compilers Compile

    Offline Compilers Offline

    GNU g++
    LLVM clang++

    download page

    Microsoft Visual C++

    Only newer versions are largely conforming to the modern ISO C++ standard(s).

    Intel ICC
    NVIDIA PGI
    NVIDIA NVC++

    part of the NVIDIA HPC SDK

    Embarcadero C++ Compiler

    bundled with Embarcadero C++Builder

    Oracle C++ Compiler

    bundled with Oracle Developer Studio

    IBM XL C++

    Online Compilers Online

    Compiler Explorer
    • lets you run code through many different compilers
    • shows nicely annotated assembly output
    • lots of compilers with lots of different versions, also with experimental features
    • supports several popular libraries (ranges, {fmt}, …)
    • great text editor with multiple cursors, VIM mode, dark mode, …
    • code round-trip between Compiler Explorer, C++ Insights and Quick Bench possible
    Wandbox
    • gcc
    • clang
    • C++03 - C++2a
    • Boost
    Coliru
    • gcc
    C++ shell
    • gcc 4.9
    • Boost 1.55
    • C++03 - 14
    IDEone
    • C++14

    Debugging Debug

    gdb

    the GNU debugger

    lldb

    the LLVM project's debugger

    rr
    • records program state over time
    • replay & debug same recording many times
    • reverse execution
    • chaos mode for catching intermittent bugs
    • claims to be faster and more memory efficient than gdb
    WinDbg

    does also provide record & replay debugging like rr (here called time travel debugging)

    gdb Frontends gdb

    cgdb
    • runs in the command line
    • split screen with source code window
    • shows break points and current instruction
    • install on Ubuntu/Debian/WSL: sudo apt install -y cgdb
    gdbgui
    • browser-based frontend for gdb
    • install via pip: sudo pip install gdbgui
    DDD
    • official GNU debugger frontend
    • The UI is a bit old-fashioned, but it is actually quite usable if you spend some time with it.
    • install on Ubuntu/Debian/WSL: sudo apt install -y ddd
    WinGDB

    debugging with GDB in Microsoft Visual Studio

    Online GDB Online compiler and debugger tool for C, C++, Python and many other languages.

    Code Analysis Analyze

    Sanitizers

    ASAN
    • g++ -fsanitize=address
    • clang++ -fsanitize=address
    • cl.exe /fsanitize=addressMSVC (as of 10/2019)
    UBSAN
    • g++ -fsanitize=undefined
    • clang++ -fsanitize=undefined
    LeakSanitizer
    • g++ -fsanitize=leak
    • clang++ -fsanitize=leak
    ThreadSanitizer
    • g++ -fsanitize=thread
    • clang++ -fsanitize=thread

    Stand-Alone Analysis Tools Stand-Alone Tools Stand-Alone

    valgrind
    • code instrumentation framework
    • runs program on a VM
    • --tool=memcheck leak, invalid read/write detection
    • --tool=callgrind runtime profiling
    • --tool=cachegrind cache profiling
    • --tool=massif heap memory profiling
    • integration into various IDEs
    Dr. Memory
    • dynamic instrumentation (runs on unmodified binaries)
    • leak detection
    • invalid memory read/write detection
    HeapTrack
    • heap memory profiler
    • annotation of memory allocations
    Application Verifier
    Deleaker
    • memory leak detection
    • integration into various IDEs
    CppDepend
    • source code analysis tool
    • code quality metrics
    • coding standard compliance analysis
    • dependency visualization
    • Visual Studio add-in

    Profiling & Benchmarking Profile

    Profiling Applications Applications

    GNU Profiler (gprof)
    • ubiquitous
    • free software
    • some IDEs can present gprof results in a GUI
    Intel VTune Profiler
    • free of charge
    • GUI & command line interface
    • sampling-based profiling
    • hardware event sampling for Intel chips
    • locks & waits analysis
    • memory access analysis
    • storage analysis
    • integrates with MS Visual Studio
    Coz – Causal Profiler
    • unique approach to profiling
    • creates causal profile: "optimizing function X will have effect Y"
    • profile is based on performance experiments
    • program is partioned into parts based on progress points (that are set in source code)
    • no additional instrumentation of source code required
    OProfile
    perf
    • free software
    Valgrind (cachegrind, callgrind)
    • free software
    Apple Instruments
    • part of XCode
    NVIDIA Nsight Compute
    • profiling for NVIDIA GPUs (architectures: Paspal, Volta, Turing)
    • supplants NVIDIA Visual Profiler
    DTrace
    • free software
    Optick
    • instrumentation-based and sampling-based profiling
    • GPU counters
    GlowCode
    SmartBear AQTime
    Arm MAP
    Oracle Performance Analyzer
    Easy Profiler

    Benchmarking Libraries / Frameworks Libraries / Frameworks Libraries

    Google Benchmark
    • Apache-2.0
    gperftools

    (originally Google Performance Tools)

    • BSD-3-Clause
    • high-performance multithreaded malloc()
    • heap checker
    • heap profiler
    • cpu profiler
    Celero
    • Apache-2.0
    plf::nanotimer
    • zlib
    simple, cross-platform microsecond-precision timer class
    Catch2
    • BSL-1.0
    unit testing framework that also includes timing primitives

    Build Systems Build

    GNU Make

    Quite OK for small projects. Every C++ programmer should know how to use Make.

    • ubiquitous, portable
    • a lot of limitations
    • not very expressive syntax
    CMake

    Seems to be(come) the de-facto standard in the C++ world.

    • available on a lot of platforms
    • lot of tutorials, resources, etc.
    • used as project model by some IDEs
    • can be slow at times
    • carries a lot of techincal debt
    • clumsy syntax

    Bazel
    • fast, seems to scale well
    • rather rigid project organization
    • has many dependencies itself
    MSBuild
    build2
    • uniform across platforms, no project generation step
    • supports wildcard patterns
    • support for C++ Modules
    • support for cross-compilation
    • skips recompilation of ignorable changes (comments, whitespaces, etc).
    • dependency management
    • no dependencies, only C++ compiler required
    QMake Part of the Qt Project .
    SCons
    • automatic dependency analysis
    • uses a real programming language (Python) for config files
    • pretty verbose; even common tasks require a lot of code
    • can be slow for big projects
    Premake
    Ninja
    Meson
    FASTbuild
    Gradle
    Waf
    Evoke Fairly new system still under development.
    GNU autotools

    My advice: stay away from autotools if you can.

    Unit Testing Frameworks Test

    DocTest  
    • MIT
    • probably the best choice for small/quick projects
    • approach allows for well-structured, self-documenting tests
    • modeled after Catch2 (shares some code with it)
    • easy to set up, one header only
    • very fast compilation & execution
    • very good and concise documentation
    Catch2  
    • BSL-1.0
    • approach allows for well-structured, self-documenting tests
    • relatively easy to set up
    • very good and concise documentation
    • data generation helpers
    • set of predefined matchers for comparing values
    • microbenchmarking tools
    • logging
    Google Test
    • BSD 3-Clause "New" or "Revised"
    Boost Test
    • BSL-1.0
    CUTE
    • LGPL3
    QtTest Part of the Qt Project .
    Mull
    • Apache-2.0
    • LLVM-based
    Bandit
    • MIT
    CppUTest
    • BSD-3-Clause
    UnitTest++

    Package Management Package

    conan
    • decentralized
    • build systems: CMake, MSBuild, …
    • binary packages
    vcpkg
    • Visual Studio integration
    • CMake support
    • only builds from source
    spack
    • programming-language agnostic (C, C++, Python, R, …)
    • originated in HPC / scientific computing community
    • can install many coexisting variants of library package versions and build configurations
    Hunter
    • CMake only
    Buckaroo
    • GitHub, BitBucket, GitLab, …
    • integrates into various IDEs

    Code Editing / IDEs Code

    IDEs

    Qt Creator
    • quite beginner-friendly
    • very responsive UI
    • has a VIM emulation mode (could be better, but it works)
    JetBrains CLion
    • lots of features
    • highly customizable, modern UI
    • uses CMake as project model, however recent versions can also use traditional Makefiles
    • has a VIM emulation mode (could be better, but it works)
    • can be a bit slow for very large projects
    • can be quite overwhelming for beginners
    • free for students
    Microsoft Visual Studio
    • packed with features; very good autocompletion and code analysis
    • large ecosystem of third-party plugins
    • project setup and compiler configuration can be a bit overwhelming for beginners
    • can be quite overwhelming for beginners
    • Make sure to use the latest version, as only newer versions of the compiler are largely conforming to the modern ISO C++ standard(s).
    Embarcadero C++Builder

    Free Community Edition

    the free community edition includes a (very) small business commercial license
    Apple XCode
    Eclipse CDT
    • good static analysis & linting
    • supports several project build models: fully managed, Makefile-based, …
    • setup of compilers can be a bit confusing to beginners
    • great VIM emulation with Vrapper plugin
    • can be a bit slow for very large
    • UI feels a bit dated
    Embarcadero Dev-C++
    • quite beginner-friendly, very easy to set up
    • gcc integration, comes with bundled TDM-gcc
    • gprof integration
    • low memory consumption
    • UI feels a bit dated
    Android Studio
    based on JetBrains IntelliJ IDEA which is also the base of CLion
    Cevelop
    • Eclipse-based IDE
    • some unique features regarding static analysis and refactoring, like e.g., visualizing template instantiations
    • can be a bit slow for very large projects
    Kdevelop
    OS X version is experimental
    CodeLite
    CodeBlocks
    OS X version is outdated
    Oracle Developer Studio

    Text Editors Editors

    Visual Studio Code
    • nice modern UI
    • thriving extension ecosystem
    • origin of the Language Server Protocol
    • highly configurable VIM plugin with surround, easymotion, highlightedyank, …
    VIM

    A classic and insanely powerful.

    Has quite a steep learning curve, but the modal editing paradigm is really worth learning. Only real drawback: once you grok it, you want VIM-style editing everywhere.

    highly customizable, large plugin ecosystem

    neovim
    • a refactor of VIM and mostly compatible with it
    • integrated LSP support planned for the next major release
    Emacs

    Also a classic; also super powerful.

    Sublime Text
    • sleek UI
    • probably the fastest of all text editors
    • highly customizable, large plugin ecosystem
    atom.io
    • nice UI
    • customizable, large plugin ecosystem
    • sometimes a bit sluggish
    Notepad++

    A classic in the Windows world. Quite OK, but not as powerful as the other editors in this list.

    Code Formatters Formatters

    clang format
    part of the llvm/clang project
    Artistic Style
    stand-alone tool

    Source Code Management SCM

    SCM Systems Systems

    Git

    The de-facto industry standard for version control.

    • very fast
    • possible to set up elaborate workflows
    • complex command line interface
    Mercurial

    Python-based source control management system.

    • easier to learn than git
    • beginner-friendly documentation
    • a bit slower than git
    • some, more involved workflows not possible out-of-the box

    Tools

    tig

    Command Line Git Frontend

    • VIM-style key mapping
    • commit view with branch graph
    • (un-)staging, diff, stash, log, grep
    • configurable UI
    Sublime Merge

    Git Merging / Commit Crafting Tool

    • very fast UI
    • line-by-line staging
    • commit editing
    • diff view, same syntax highlighting as Sublime Text
    • multiple repositories (in tabs)
    • can use external or bundled git client

    Web Tools Web

    Compiler Explorer
    • lets you run code through many different compilers
    • shows nicely annotated assembly output
    • lots of compilers with lots of different versions, also with experimental features
    • supports several popular libraries (ranges, {fmt}, …)
    • great text editor with multiple cursors, VIM mode, dark mode, …
    • code round-trip between Compiler Explorer, C++ Insights and Quick Bench possible
    C++ Insights Source-to-source transformation tool that makes behind-the-scenes compiler magic visible and understandable. Shows the code that clang generates for lambdas, range-based for loops, structured bindings, etc.
    Quick Bench Benchmark code (using Google Benchmark) and get a nice graphical runtime breakdown. You can choose from various versions of gcc or clang.
    Online GDB Online compiler and debugger tool for C, C++, Python and many other languages.