views:

546

answers:

5

Hey guys,

I'm working on a commercial project that requires a couple of files to be bundled (packed) into an archive and then compressed. Right now we have zlib in our utility library, but it doesn't look like zlib has the functionality to compress multiple files into one archive. Anyone know of free libraries I'd be able to use for this?

TIA.

+3  A: 

You could use libzip - it's under a BSD-like licence so it should be usable in a commercial project.

bdonlan
+7  A: 

Perhaps libtar? Also under a BSD license.

Amber
It looks like libtar is a good solution for this project. Thanks everyone for your speedy replies.
Justin
+2  A: 

To compress multiple files into one zip archive you could use Zipios++

Alan
+10  A: 

7Zip has a full SDK for several languages including C and C++. The compression is extremely good, albeit not very fast. The code is licensed under the LGPL.

jdisk
7Zip also has decent support for AES encryption.
Marsh Ray
Personally, I'm a fan of 7Zip, but the LGPL might cause problems in this situation.
Justin
The LZMA SDK portion of 7-Zip is in the public domain, so no LGPL concerns apply. If you want all of 7-Zip's features (not just LZMA), then 7-Zip itself is under the LGPL, but this isn't a problem for commercial apps as long as you leave it in a DLL, include a copy of the LGPL in your distribution, and provide source upon request.
Josh Kelley
+1  A: 

Also have a look at bzip2.

Vijay Mathew
bzip2 cannot compress multiple files into an archive. You typically use tar to join all your files into one before giving it to bzip.
Andrew Bainbridge