A single-header C/C++ library for embedding binary and text files directly into executables using compiler inline assembly.
incbin is a single-header C/C++ library that allows developers to embed binary files (like images, audio, or text) directly into their executables at compile time. It solves the problem of managing external asset dependencies by converting files into static arrays that are linked into the program, making deployment simpler and improving runtime performance by eliminating file I/O.
C/C++ developers working on embedded systems, game development, or applications where bundling assets with the executable is required, especially those targeting multiple compilers and platforms.
Developers choose incbin for its extreme portability across compilers, zero runtime overhead, and flexibility in symbol naming and alignment—all without external dependencies, unlike heavier asset management libraries.
Include binary files in C/C++
Works with GCC, Clang, MSVC (via tool), and over 15 other compilers, making it ideal for cross-platform projects without vendor lock-in.
Embeds data directly into the executable at compile time, eliminating file I/O and external dependencies for faster asset access.
Allows prefix and style changes via INCBIN_PREFIX and INCBIN_STYLE macros to match existing coding conventions and naming schemes.
Detects SIMD extensions and aligns data appropriately (e.g., 16 bytes for SSE, 32 for AVX), optimizing for vectorized code use cases.
MSVC support requires a separate preprocessing tool and integration into pre-build events, and it currently lacks INCTXT and custom type support.
Embedding large binary files directly increases executable size, which can be problematic for memory-constrained embedded systems or deployment.
INCTXT adds a NUL-terminator, but the size symbol includes it, requiring developers to subtract one for accurate string length, introducing potential errors.
Protocol Buffers - Google's data interchange format
A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.
JSON for Modern C++
ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.