Click here to Skip to main content
15,914,820 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all, I need a zip library (or a function) that can zip file in c++.
please help me
thanks

What I have tried:

I tried zlib, minizib, ... but I can't find a solution
Posted
Updated 12-Dec-18 2:15am
Comments
Rick York 12-Dec-18 12:30pm    
What's wrong with zlib? I have used it for years in lots of projects and it works fine. It is also part of the standard PNG library.

1 solution

What you cannot find is a built-in C++ function that does this. Because there isn't any. C++ is a language and relies upon the underlying runtime/framework to provide file system and other support. This question has been asked on CodeProject a lot times as well, for example look here, Zip Files in C++[^]

One way to do is, using boost libraries. But again, you would have to make the pegs work correctly. Other way is by using other libraries that you have already seen. The solution is to properly write the functions that take the file, compress the stream, then write the stream as an archived file.

Share your code that you have tried, and we would be able to guide you further.

c++ - The best zip library with public domain license - Stack Overflow[^]
C++ cross-platform zlib simplifer-wrapper - Stack Overflow[^]
c++ - Cross platform file archiving - Stack Overflow[^]

If you still do not know, here is the website[^] for one of the libraries that you said you explore but didn't find a solution for, you can see that provide a sample app as well, you should download and see how that works.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900