bin2cpp is a command-line tool written in C++20 that embeds binary files into C++ headers.
The generated output files are structured as follows:
#pragma once
constexpr unsigned char yourFileName[fileSize]{};- CMake
You can install bin2cpp in several ways:
-
Download the latest pre-built binaries from the latest release.
-
If you are on an Arch-based system, you can install it from the AUR:
yay -S bin2cpp-git
-
To build bin2cpp from source, run:
mkdir build cmake -S . -B build cmake --build build --config Release
To use bin2cpp, simply run:
bin2cpp yourFile