Go from install → new → build → run → pack in 5 minutes.
You only need a Linux x86_64 or macOS ARM64 environment — no need to install GCC, xlings, or any other dependencies beforehand.
On its first run, mcpp installs the default toolchain into an isolated sandbox (~/.mcpp/).
Linux defaults to musl-gcc, while macOS defaults to LLVM/Clang.
We recommend installing via xlings, which keeps mcpp isolated from your system environment:
xlings install mcpp -yAlternatively, use the one-line installer script (xlings is bundled, and everything is installed under ~/.mcpp/):
curl -fsSL https://github.com/mcpp-community/mcpp/releases/latest/download/install.sh | bashFor full installation instructions (including xlings install commands, Windows support, and more), see the "Installation" section of the README.
Once installation is complete, start a new shell session or run source ~/.bashrc, then verify:
mcpp --version
# mcpp 0.0.1Tip
If you get command not found, it usually means ~/.mcpp/bin has not yet
been added to the current shell's PATH. Restart your terminal, or run
source ~/.bashrc (use ~/.zshrc for zsh, or exec fish for fish) to
apply the change. You can also invoke mcpp directly via its absolute path
~/.mcpp/bin/mcpp.
mcpp new hello && cd helloThis generates the following directory structure:
hello/
├── mcpp.toml ← project manifest
└── src/
└── main.cpp
By default, src/main.cpp is a C++23 modular hello world:
import std;
int main() {
std::println("Hello from hello!");
std::println("Built with import std + std::println on modular C++23.");
}mcpp build
# Compiling hello v0.1.0 (.)
# Finished release [optimized] in 1.6s
mcpp run
# Hello from hello!
# Built with import std + std::println on modular C++23.The first build downloads the default toolchain (musl-gcc 15.1 on Linux, LLVM/Clang 20.1 on macOS), showing progress and speed along the way. Once downloaded, all mcpp projects share the same sandbox.
mcpp build # incremental build
mcpp clean # clean target/
mcpp test # compile and run tests/**/*.cpp (gtest style)Declare dependencies in mcpp.toml:
[dependencies]
"mcpplibs.cmdline" = "^0.0.1"mcpp build automatically resolves SemVer constraints against the
mcpp-index, fetches the source,
and adds it to the build graph. For a complete example, see 02-with-deps in
01 — Examples.
mcpp pack bundles your build artifacts and runtime dependencies into a self-contained tarball that can be distributed independently:
mcpp pack # default bundle-project, includes the project's third-party .so files
mcpp pack --mode static # fully static (musl)
mcpp pack --mode bundle-all # fully self-contained, including libc and ld-linuxFor the differences between the three modes and their artifact layouts, see 02 — Packaging and Release.
- 01 — Examples — a collection of ready-to-run minimal projects
- 02 — Packaging and Release — building distributable artifacts
- 03 — Toolchain Management — switching compilers and managing multiple versions
- The full set of options for any command is available via
mcpp <cmd> --help
- GUI quickstart:
mcpp new myapp --template imgui(templates are distributed with the imgui library and their versions are aligned automatically; runmcpp new --list-templates imguito see all templates the library provides, or use--template imgui:dockingto select a specific one). - Explaining default decisions:
mcpp why [toolchain|runtime|deps]; host capability checkup:mcpp self doctor; machine-readable resolution manifest: the build artifacttarget/<triple>/<fp>/resolution.json.