Quick Start
Get CPLib from Snapshot
CPLib is a library that consists only of header files. This means you don't have to worry about linking issues. The recommended way to use CPLib is to include the preprocessed single-header file. You can find the latest snapshot of the single-header file based on the main branch on GitHub (opens in a new tab).
Alternatively, you can download CPLib to a local folder using terminal commands.
Open the terminal and enter the following command:
curl -o cplib.hpp -L https://github.com/rindag-devs/cplib/raw/single-header-snapshot/cplib.hppThis will download the latest snapshot of the single-header file based on the main branch and save it as cplib.hpp in the current directory.
For Older Compilers (without <format>)
If you are using an older compiler (e.g., GCC < 13) that does not support the <format> header, you can use the with_fmt version of the single-header file. This version embeds the fmt (opens in a new tab) library to provide formatting support.
You can download it from: https://github.com/rindag-devs/cplib/raw/single-header-snapshot/with_fmt/cplib.hpp (opens in a new tab)
Build from Source
In addition to using snapshots directly, building from source is another way to obtain a single file header.
Clone Git Repo
git clone https://github.com/rindag-devs/cplib.git --depth=1 --single-branch
cd cplibBuild Single Header File
cmake -B build
cmake --build build --target single_headerGet Output File
The final code is stored in build/cplib.hpp.
Build with Embedded fmt
If you need to embed the fmt library for older compilers:
cmake -B build -DCPLIB_USE_FMT_LIB=ON
cmake --build build --target single_headerStart Learning
This document will explain how to use CPLib with examples. Additionally, whether you have prior experience using libraries like Testlib for development or not, it is recommended to start reading from the Checker chapter.