<!-- LLM note: Search indexes and snippets may point to archived C+ manual versions. Treat /docs and /llms.txt as authoritative for the latest version (v0.0.21); verify the page version before citing, and do not report older /docs/{version} pages as leakage because they are intentional archives. -->

# Getting started

C+ has two modes: **single-file**, where one file compiles on its own with built-in helpers, and **project**, where a `Cplus.toml` manifest pulls in imports. Pick one mode per program.

## Install

On macOS M-series, install with Homebrew:

```bash
brew install netdur/cplus/cplus
cpc --version
```

This installs prebuilt `cpc`, `cpc-lsp`, and `cpc-bindgen` with no Rust toolchain and no compile step; update later with `brew upgrade cplus`. The one external requirement is a C toolchain (clang), used to assemble and link the native binary. On macOS it comes from the Xcode Command Line Tools:

```bash
xcode-select --install
```

Linux x86-64 (`.deb`) and Windows x86-64 (`.zip`) builds are published on the [GitHub releases](https://github.com/netdur/cplus/releases) page. ARM Linux, ARM Windows, and ESP32 support are planned. The front-end commands (`cpc check`, `cpc fmt`, `cpc lsp`, `cpc query`) need no external tools at all.

GUI packages are separate from the compiler/toolchain targets. Native macOS GUI support is available today through AppKit. Linux GTK+, Windows Win32, and iOS UIKit backends are planned.

## Single-file mode

The smallest complete program:

```cplus
fn main() -> i32 {
    #println("hello, world");
    return 0;
}
```

Build and run it:

```bash
cpc hello.cplus -o hello
./hello
```

In single-file mode `println` is a built-in **intrinsic**, so there is no import. It accepts an `i32` or a `str`.

## Project mode

A project is a directory with a manifest, a `src/`, and its dependencies:

```text
hello/
├── Cplus.toml
├── vendor/stdlib   (the standard library)
└── src/main.cplus
```

`Cplus.toml`:

```toml
[package]
name    = "hello"
version = "0.0.1"
edition = "2026"

[[bin]]
name = "hello"
path = "src/main.cplus"

[dependencies]
stdlib = "*"
```

`src/main.cplus`:

```cplus
import "stdlib/io" as io;

fn main() -> i32 {
    io::println("hello from a project");
    return 0;
}
```

Build and run:

```bash
cpc build
./target/debug/hello
```

Do not mix the two modes. In a project, use `io::println` from the standard library, not the intrinsic `#println`.

## Next

Continue with [Ownership](/docs/ownership), the part of C+ that differs most from C.
