I am trying to create a compressed archive on windows with libarchive and at the moment it is not working. I can create zip or pax_restricted(tar) archives without compression, without any problems.
To add compression I've tried some combinations of the following:
archive_write_set_compression_lzip(lWriteArchive);
archive_write_add_filter_lzip(lWriteArchive);
archive_write_set_compression_gzip(lWriteArchive);
archive_write_add_filter_gzip(lWriteArchive);
archive_write_set_format_zip(lWriteArchive);
archive_write_set_format_pax_restricted(lWriteArchive);
I've mainly tried using lzip compression with the zip format and gzip compression with the pax_restricted format.
First I'm not sure whether I should use archive_write_set_compression_* or archive_write_add_filter_*.
When I try add lzip compression and I step into the function I see it returns ARCHIVE_FATAL with the error message "lzma compression not supported on this platform".
When I try to add gzip compression and I step into the function I see it returns ARCHIVE_WARN with the error message "Using external gzip program". If I let the process go on the resulting archive has a size of zero.
I get the feeling like on unix systems there are system libraries for lzma and gzip that libarchive uses for compression and that these are not available on windows.
I built libarchive using the latest stable release, following the the instructions to use CMake etc. I didn't notice any errors in the CMake configuration like I was missing lzma or gzip.
Thanks for any help.