I want to be able to zip files from my non-gui C/C++ application, on several versions of Windows, Linux/Unix, and MacOS.
The user will compile and run using this app using Eclipse + makefile or VisualStudio. I don't want the user to have to install something separately, or have my makefile install executables.
Prefer open-source. I'm already looking at "Zip 3.0"...
Take a look at Libarchive. I spent a lot of time seeking for a cross-platform and LGPL licensed library with convenient interface. This the best of all I've seen. Very easy and powerful tool. Originally designed for Unix-like systems but there's also the Windows version.
I've had great results with miniz: https://code.google.com/p/miniz/
For a simple compression of strings in c++, I also really like Timo Bingmann's solution.
I'd recommend ZipLib https://bitbucket.org/wbenny/ziplib/wiki/Home
Personal reasons why I love this project:
- built around c++11 stl streams (ex. decompresses into stl streams!)
- lightweight (no dependencies other than zlib)
- can be used on both windows & liunx
It took me a long time to find this project - hope this helps someone.
We've used zlib a couple times here. It's a fairly standard library that has implementations in most main languages.
How about this:
http://zziplib.sourceforge.net/
http://www.info-zip.org/UnZip.html
HTH
ZLIB - the most portable library in the world. open source, very proven and reliable. The gold standard.
why use anything else?
Others have mentioned zlib, which is nice and fairly easy.
The 7-Zip (LZMA) SDK is more complex but also has very nice compression rates.
Edit: Although still in development, with the release process and history over time, I would be hesitant to recommend this now.