portable zip library for C/C++ (not an application

2019-01-07 14:46发布

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"...

标签: c++ zip
8条回答
做自己的国王
2楼-- · 2019-01-07 14:55

We've used zlib a couple times here. It's a fairly standard library that has implementations in most main languages.

查看更多
神经病院院长
4楼-- · 2019-01-07 14:59
干净又极端
5楼-- · 2019-01-07 15:01

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.

查看更多
神经病院院长
6楼-- · 2019-01-07 15:07

ZLIB - the most portable library in the world. open source, very proven and reliable. The gold standard. why use anything else?

查看更多
ら.Afraid
7楼-- · 2019-01-07 15:11

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.

查看更多
登录 后发表回答