English | 简体中文
From nothing to a C++23 project that imports a library from this index. Six commands, no build-system configuration.
xlings install mcpp -yDon't have xlings yet?
# Linux / macOS
curl -fsSL https://d2learn.org/xlings-install.sh | bash# Windows · PowerShell
irm https://d2learn.org/xlings-install.ps1.txt | iexmcpp new hello
cd hello
mcpp runThe first build fetches the toolchain, so it takes a while; later builds are incremental. What the scaffold gives you:
hello/
├── mcpp.toml ← project manifest
└── src/
└── main.cpp ← `import std;` works out of the box
mcpp add nlohmann.json@3.12.0The name is the one shown on every package page — namespace.name. The
command writes the dependency into your mcpp.toml:
[dependencies.nlohmann]
json = "3.12.0"nlohmann.json is exposed as a C++23 module, so there is no header to find
and no include path to configure:
// src/main.cpp
import std;
import nlohmann.json;
int main() {
nlohmann::json j = { {"answer", 42}, {"list", {1, 2, 3}} };
std::println("{}", j.dump());
}Every package page tells you which line to write: import x; for module
packages, #include <x> for the compat.* ports, and it is taken from this
repository's own tests — code CI compiles.
mcpp runThat is the whole loop: mcpp add → import → mcpp run.
Using packages
- Package types — the four library shapes in this index and what each one means for you as a consumer
- CN mirror — how packages resolve from the GitCode mirror in mainland China
Contributing a package
- Adding a package — the end-to-end procedure
- Repository & schema — descriptor fields, CI behaviour, how to reproduce lint locally
mcpp itself
- mcpp README — build system, toolchain management, the full command set
- mcpp.toml guide — version constraints, git references, local paths