Hello, Project Builds
English

Hello, Project Builds

Single-file compilation is great for quick experiments. The moment you want a named binary and a project directory, scpp’s manifest-based build mode is more comfortable.

Create a directory, then add scpp.toml at the top level and main.scpp under src/.

scpp.toml:

manifest-version = 1

[package]
name = "starter"
version = "0.1.0"

[[bin]]
name = "hello"
sources = ["src/**/*.scpp"]

src/main.scpp:

import std;

int main() {
    std::println("Hello from a project build!");
    return 0;
}

From that directory, build the project:

scpp build
./.scpp/build/*/dev/starter/hello

Output:

Hello from a project build!

The * in the output path expands to your target triple, such as x86_64-pc-linux-gnu. scpp places build artifacts under .scpp/build/, so the project directory itself stays small and predictable.

This is enough for a first chapter:

The next chapter stays hands-on, but switches from setup to a slightly larger program: a guessing game that reads input, generates a secret number, and uses ordinary variables, loops, and conditions together.


← Previous: Hello, World! · Table of Contents · Next: Programming a Guessing Game →