All formats

7z libraries for C/C++

For C and C++ there are 3 good choices:

Pick libarchive when you handle several archive formats and don’t need encryption; the LZMA SDK for a small, dependency-free extractor; bit7z when you need full 7-Zip features on Windows, Linux or macOS.

The full 7-Zip source code (C++, LGPL with an unRAR restriction for the RAR decoder) is at github.com/ip7z/7zip if you want to build a 7z encoder into your program directly.