RAR libraries for C/C++
For C and C++ there are 2 choices:
- UnRAR library is RARLAB’s own extraction code, built as a shared library (
unrar.dll,libunrar.so) with a small C API. It supports every RAR feature: RAR4 and RAR5, encrypted files and headers, volumes, RAR 7.0 large dictionaries. Its license allows use in any program that extracts RAR but forbids building a RAR-compatible archiver, and it isn’t an OSI open-source license. - libarchive reads RAR4 and RAR5 with the same API it uses for ZIP, 7z, TAR and many other formats. BSD license. It doesn’t decrypt password-protected RAR archives and doesn’t extract solid RAR4 archives (solid RAR5 works).
Pick the UnRAR library when you must open any RAR file a user throws at you, including encrypted ones. Pick libarchive when you handle many archive formats and want a permissive license.
- libarchive libarchive reads RAR4 and RAR5 archives in C and C++ under a BSD license. How to install it, list and extract RAR files, read entries into memory.
- UnRAR library The UnRAR library from RARLAB extracts RAR4 and RAR5 archives in C and C++. How to build it, list files, extract to disk or memory, handle passwords.