Coder Social home page Coder Social logo

quazip's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quazip's Issues

Polyspace report on your library

Hello,

Thank you for this library.

Here are some "bug" returned by our tool (polyspace bug finder) that may interest you to improve your library (I used 0.9.1 tag):
polyspace report.pdf

Feel free to close this issue if you don't think it is relevant.

Test executable not being buitl on 1.x

Unless I'm doing something wrong, I have Qt5Test and Qt5Network in addition to Qt5Core.

ctest fails with:

Unable to find executable: /home/abuild/rpmbuild/BUILD/quazip-1.1/build/qztest/qztest
1/1 Test #1: qztest_test ......................***Not Run   0.00 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.00 sec

The following tests FAILED:
          1 - qztest_test (Not Run)
Errors while running CTest

Build quazip on EL8

Hi ...
I'm unable to build quazip from source because so far qt4 is unavailable on EL 8.2.
Is it possible to strip out from quazip the build portion that is qt4 dependent ?
Is there any easy way to achieve it ?
Thanks.

Can't build on MacOS

Running qmake && make errors out; turns out this is happening because zlib isn't being added to the LIBS, so the linker doesn't know what to do about it.

Changing quazip/quazip.pro to include the lib when mac is detected fixes this.

static linking exception question

Hey,

thanks for QuaZip. I have a question about the static linking exception. With it you allow to static linking quazip f.e. i have a exe called mytool.exe (i assume windows) and it is dynamically linked to Qt5Core.dll, and now it is allowed to link QuaZip statically to mytool.exe. Is it also allowed to link statically to a shared library like mylib.dll? If it's allowed, please can you add some term like shared libraray also to the exception, because it would clarify the situation (also the "it's not allowed to link statically to shared libs" if that's your wish).

Thanks in advance
Tonka

STATIC LINKING EXCEPTION

The copyright holders give you permission to link this library with
independent modules to produce an executable, regardless of the license
terms of these independent modules, and to copy and distribute the
resulting executable under terms of your choice, provided that you also
meet, for each linked independent module, the terms and conditions of
the license of that module. An independent module is a module which is
not derived from or based on this library. If you modify this library,
you must extend this exception to your version of the library.

Crash when extracting archives on Ubuntu using JlCompress

We've just started integrating quazip with out software, and it has worked wonderfully for our purposes on MacOS and Windows.
However, on Linux, we get peculiar behavior when the qiodevice64_seek_file_func callback is executed from ZLib code (presumably). The memory at stream does not appear to be initialized in this instance (crash at qioapi.cpp:253).

Call Stack:

libquazip5.so.1!qiodevice64_seek_file_func(voidpf stream, ZPOS64_T offset, int origin) (/home/user/Development/lib/quazip/quazip/qioapi.cpp:253)
unzGoToFirstFile (Unknown Source:0)
libquazip5.so.1!unzOpenInternal(voidpf file, zlib_filefunc64_32_def * pzlib_filefunc64_32_def, int is64bitOpenFunction, unsigned int flags) (/home/user/Development/lib/quazip/quazip/unzip.c:768)
libquazip5.so.1!QuaZip::open(QuaZip * const this, QuaZip::Mode mode, zlib_filefunc_def * ioApi) (/home/user/Development/lib/quazip/quazip/quazip.cpp:258)
libquazip5.so.1!JlCompress::extractDir(QuaZip & zip, const QString & dir) (/home/user/Development/lib/quazip/quazip/JlCompress.cpp:369)
libquazip5.so.1!JlCompress::extractDir(QString fileCompressed, QTextCodec * fileNameCodec, QString dir) (/home/user/Development/lib/quazip/quazip/JlCompress.cpp:360)
libquazip5.so.1!JlCompress::extractDir(QString fileCompressed, QString dir) (/home/user/Qt5.12.1/5.12.1/gcc_64/include/QtCore/qrefcount.h:60)

Diagnostic Steps taken;

  • Valgrind does not seem to provide any clues as to the origin of the invalid memory
  • Tested with a clean image of Ubuntu 20.04 and another system also running Ubuntu 20.04. Has not been tested on other distributions
  • Compressing archives using JlCompress works as intended
  • Indeed, GDB reports that the value of the stream pointer is not that of the original QFile IOStream constructed by QuaZip.

0.7.4 tarball is not backward-compatible

The new release tarball 0.7.4 under the versioned directory 'quazip-0.7.4' has a 'quazip' subdir, while the old, SF tarballs didn't have, just directly the source tree under the versioned dir 'quazip-0.7.3'.
This breaks packaging/building setups in downstream projects (on my side: Buildroot and MXE).

Implementing a debug option to trace bugs and issues

Hi!
First, I want to thank you for making this project. It's a key component to my own project. :)

Second, a couple of suggestions:

  1. Reviewing the source code of Quazip I found that the devel comments are in Italian. I wonder if you would like to get some help to make the translation of them into English, looking for doing easier the collaboration from other coders around the world. I would like to know your thoughts about it.
  2. Tracking some issues that I have detected mostly on Windows platforms, I have noticed that there is not debugging option for the project. So, I would like to know if you would be interested in implementing a debug option to trace bugs and issues.

Just as an experiment, I made a copy of one of the Quazip classes (with a little modification of the code), just to show you how it would be an "English"/"with Debugging option" version of your project:
https://github.com/xtingray/quazip/blob/master/quazip/JlCompress.cpp

In case you like my coding proposal, please let me know.
Regards,

Instructions update

Hi! I'm having problems building quazip on windows 10. Can you update the instructions for it?

Quazip doesn't get file modification date/time

In getCurrentFileInfo, at this place in the code
info->dateTime=QDateTime(
QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday),
QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec));

the information in info_z.tmu_date is completely bogus. Most of the data is 0, the year is 1980, and the month is 4294967295. I can see in 7-Zip that the correct information should be 2018-02-23 16:37

I don't see version information for quazip, but the copyright is 2005-2014.
unzip.c has version 1.1

quazip fails to unzip zip64 archive with extra leading data (e.g. self-extractor)

quazip will correctly unzip a normal (32-bit) zip archive even if the self-extractor is pre-pended. However if the archive is large are requires ZIP64 extensions then the extraction will fail. The search for ZIP64 end of central directory fails if the correct signature is not found pointed to by the ECL record, for non-ZIP64 archives the analogous routine will actually search backward for the central directory.

The Info-Zip version of unzip will make a guess that the ZIP64 End of Central directory is exactly 56 bytes before the locator record if the lookup using the explicit offset fails. I have implemented a similar solution for libquazip for use in my application. It seems to work well for me. I will issue a pull request for this change if you wish.

The issue is that unz64local_SearchCentralDir64 does not have any other options on line 574 if the signature check fails.

Build errors with Qt 5.15

I cloned quazip and build the zlib dependency.
Than I run

$ C:\Qt\5.15.0\mingw81_64\bin\qmake.exe "LIBS+=-L./zlib_windows/bin -lzlib1" "INCLUDEPATH += ./zlib_windows/include" PREFIX=../dist
$ make

and get the following output:

...
g++ -c -fno-keep-inline-dllexport -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DQUAZIP_BUILD -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I. -IC:/Qt/5.15.0/mingw81_64/include -IC:/Qt/5.15.0/mingw81_64/include/QtCore -Irelease -IC:/Qt/5.15.0/mingw81_64/mkspecs/win32-g++  -o release/moc_quazipfile.o release/moc_quazipfile.cpp
quazipfileinfo.cpp: In function ‘QFileDevice::Permissions permissionsFromExternalAttr(quint32)’:
quazipfileinfo.cpp:31:31: error: invalid conversion from ‘int’ to ‘QFileDevice::Permission’ [-fpermissive]
   31 |     QFile::Permissions perm = 0;
      |                               ^
      |                               |
      |                               int
In file included from C:/Qt/5.15.0/mingw81_64/include/QtCore/qglobal.h:1302,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/qatomic.h:41,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/qrefcount.h:43,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/qbytearray.h:44,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/QByteArray:1,
                 from quazipfileinfo.h:28,
                 from quazipfileinfo.cpp:25:
C:/Qt/5.15.0/mingw81_64/include/QtCore/qflags.h:121:41: note:   initializing argument 1 of ‘constexpr QFlags<T>::QFlags(Enum) [with Enum = QFileDevice::Permission]’
  121 |     Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {}
      |                                    ~~~~~^~~~~
quazipdir.cpp: In member function ‘bool QuaZipDir::cd(const QString&)’:
quazipdir.cpp:106:71: error: ‘SkipEmptyParts’ is not a member of ‘QString’
  106 |         QStringList path = dirName.split(QLatin1String("/"), QString::SkipEmptyParts);
      |                                                                       ^~~~~~~~~~~~~~
JlCompress.cpp: In static member function ‘static bool JlCompress::compressDir(QString, QString, bool)’:
JlCompress.cpp:264:56: error: invalid conversion from ‘int’ to ‘QDir::Filter’ [-fpermissive]
  264 |     return compressDir(fileCompressed, dir, recursive, 0);
      |                                                        ^
      |                                                        |
      |                                                        int
In file included from C:/Qt/5.15.0/mingw81_64/include/QtCore/qglobal.h:1302,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/qchar.h:43,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/qstring.h:49,
                 from C:/Qt/5.15.0/mingw81_64/include/QtCore/QString:1,
                 from quazip.h:28,
                 from JlCompress.h:29,
                 from JlCompress.cpp:26:
C:/Qt/5.15.0/mingw81_64/include/QtCore/qflags.h:121:41: note:   initializing argument 1 of ‘constexpr QFlags<T>::QFlags(Enum) [with Enum = QDir::Filter]’
  121 |     Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {}
      |                                    ~~~~~^~~~~
make[2]: *** [Makefile.Release:1045: release/quazipfileinfo.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile.Release:528: release/JlCompress.o] Error 1
make[2]: *** [Makefile.Release:900: release/quazipdir.o] Error 1
make[2]: Leaving directory '/c/Users/Leander Schulten/git_projects/Lichtsteuerung.git/src/lib/quazip/quazip/quazip'
make[1]: *** [Makefile:45: release] Error 2
make[1]: Leaving directory '/c/Users/Leander Schulten/git_projects/Lichtsteuerung.git/src/lib/quazip/quazip/quazip'
make: *** [Makefile:51: sub-quazip-make_first] Error 2

Cmake build does not specify project version

there is no project version definition defined in the
root CMakeLists.txt file. This can cause issues
when other buildsystems try to check the current
installed version of quazip.

Pulling this as sunmodule into my build.

So no issues with library, just have a question about pulling this in to my build tree as a submodule & subproject of my main QT project. It seems for mac/linux the zlib dependency isn't specified (!win32: LIBS += -lz) when building the dynamic library, so I really cannot build it independently without making a change (forking I guess).

Is there an alternative approach to handle this use case? As I see no other comments on this point, I suspect there might be....or everyone just forks your repo :)

Otherwise, I will probably do the same.

Thanks,
David

Linking troubles when using --no-undefined

As per subject, I'm seeing unresolved symbols when the linker is passed -Wl,--no-undefined.
Perhaps one needs to append -lz to Libs: in pkgconfig? Or maybe cmake has a cleverer way to do this?

Building qztest with qt4 fails on Linux

When building against qt4 on KDE Neon/Ubuntu 18.04 (build configured via qmake-qt4), the build fails with the following log:

n file included from /usr/include/qt4/QtCore/qvariant.h:48:0,
from /usr/include/qt4/QtCore/qlocale.h:45,
from /usr/include/qt4/QtCore/QtCore:20,
from /usr/include/qt4/QtTest/QtTest:3,
from testquazipfileinfo.cpp:10:
/usr/include/qt4/QtCore/qmetatype.h: In instantiation of ‘static int QMetaTypeId2::qt_metatype_id() [with T = QList]’:
/usr/include/qt4/QtCore/qmetatype.h:230:43: required from ‘int qMetaTypeId(T*) [with T = QList]’
testquazipfileinfo.cpp:191:5: required from here
/usr/include/qt4/QtCore/qmetatype.h:169:79: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QList >’
static inline int qt_metatype_id() { return QMetaTypeId::qt_metatype_id(); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/qt4/QtCore/qmetatype.h: In instantiation of ‘static int QMetaTypeId2::qt_metatype_id() [with T = QHash<short unsigned int, QList >]’:
/usr/include/qt4/QtCore/qmetatype.h:230:43: required from ‘int qMetaTypeId(T*) [with T = QHash<short unsigned int, QList >]’
testquazipfileinfo.cpp:325:5: required from here
/usr/include/qt4/QtCore/qmetatype.h:169:79: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QHash<short unsigned int, QList > >’

Updating quazip breaks OpenBoard

The most recent update of quazip breaks some dependants. OpenBoard will not function once quazip-1.0-1x86_64 is installed. Removing, and attempting to install OpenBoard after update results in errors stating that quazip.h is not found.

Reverting quazip back to quazip-0.9.1-1-x86_64 restores OpenBoard functionality, and allows you to install OpenBoard without any errors.

CMake-related stuff for 1.0 goes here!

This issue supersedes all of these:

PR #60: most of the CMake discussion was there, but that PR isn't even open. Easy to miss.
Issue #68: modern CMake. Good idea, but needs further discussion.
Issue #70: add options for building static/shared libraries. Should be easy, but we need to clean up CMake files first.
PR #28: consistent naming for CMake and qmake. One of the main reasons we're still stalling with 1.0.

The main problems:

  1. We need to decide with solid names for all things. CMake targets, include directories, binaries for different Qt versions, etc.

  2. We need to decide with CMake version. Modern CMake seems nice, but many distros still ship with retared CMake versions like 2.7. RHEL/CentOS 7 comes to mind as an example. Surely one can install a modern cmake from EPEL in this case, but that's not always easy: for example, I have no idea how I would go about that at my job, with no Internet access and very restricted use of external storage devices.

Once we're done with these, it will be easy to make other CMake changes, merge PRs and so on. Until then, it doesn't make much sense.

Reading file out of zip does not produce the file's contents on disk (buffered?)

First off, excellent library. Saving us tons of time. The question I have is in regard to a read after write situation. We are modifying a file inside a zip using the following:

QuaZip zip(study.filepath);
if (zip.open(QuaZip::Mode::mdAdd)) {
    QuaZipFile zipFile(&zip);
    if (zipFile.open(QIODevice::WriteOnly, QuaZipNewInfo("study_info"))) {
        QJsonObject studyJson = study.writeToJSON();
        QJsonDocument jsonDoc(studyJson);
        zipFile.write(jsonDoc.toJson());
        zipFile.close();
    } else {
        qDebug() << "Failed to update study details. Could not open study_info file.";
    }
    zip.close();
} else {
    qDebug() << "Failed to update study details. Could not open zip at: " << study.filepath;
}

If I then read that same file using:

QJsonDocument BodyvizFileUtilities::studyInfoFrom(QFileInfo bvfFile) {
    QuaZipFile zipFile(bvfFile.absoluteFilePath(), "study_info");
    if (zipFile.open(QIODevice::ReadOnly)) {
        QJsonDocument jsonDoc(QJsonDocument::fromJson(zipFile.readAll()));
        zipFile.close();
        return jsonDoc;
    }
    qDebug() << "Failed to load study details. Could not open study_info file.";
    return QJsonDocument();
}

The updated contents are not present. The contents are those of the data before updating the zip. Now, I could understand this if the zip wasn't getting updated properly on disk, but if I crack open the zip and look at the contents, the update operation is indeed working.

It's behaving as if it reading from buffered or cached data, but I can't quite figure out where that would be if that's the case. Greatly appreciate your time and any input!

Quick question about use of QuaZIODevice.

Library is working great between two QT applications, I am using QuaZIODevice to compress/decompress a memory buffer, which gets sent over the network.

My question is when using QuaZIODevice to compress a memory buffer, should there be any issues decompressing this buffer with another zlib library on IOS? Just confirming, as I need to interoperate with a non-QT application running on IOS.

The IOS developer is having issues, and I want to make sure I haven't chosen a solution that is QT specific.

Thanks.

'QuaChecksum32' has virtual functions but non-virtual destructor

When compiling with -Wnon-virtual-dtor and with warnings as errors, I get the following:

In file included from ../abc/quazip/quacrc32.cpp:25:
In file included from ../abc/quazip/quacrc32.h:28:
../abc/quazip/quachecksum32.h:52:21: warning: 'QuaChecksum32' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class QUAZIP_EXPORT QuaChecksum32
                    ^

The fix is trivial, it just needs a virtual destructor. I can submit a PR for that.

Cannot compile quazip with Qt 5.10.1

When I try to compile the quazip project with Qt 5.10.1 I get the following errors :

./debug\quaadler32.o: In function `ZN10QuaAdler329calculateERK10QByteArray':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaadler32.cpp:37: undefined reference to `adler32'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaadler32.cpp:37: undefined reference to `adler32'
./debug\quaadler32.o: In function `ZN10QuaAdler325resetEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaadler32.cpp:42: undefined reference to `adler32'
./debug\quaadler32.o: In function `ZN10QuaAdler326updateERK10QByteArray':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaadler32.cpp:47: undefined reference to `adler32'
./debug\quacrc32.o: In function `ZN8QuaCrc329calculateERK10QByteArray':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quacrc32.cpp:36: undefined reference to `crc32'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quacrc32.cpp:36: undefined reference to `crc32'
./debug\quacrc32.o: In function `ZN8QuaCrc325resetEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quacrc32.cpp:41: undefined reference to `crc32'
./debug\quacrc32.o: In function `ZN8QuaCrc326updateERK10QByteArray':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quacrc32.cpp:46: undefined reference to `crc32'
./debug\quagzipfile.o: In function `ZN18QuaGzipFilePrivate4openERK7QStringPKc':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:45: undefined reference to `gzopen'
./debug\quagzipfile.o: In function `ZN18QuaGzipFilePrivate4openEiPKc':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:50: undefined reference to `gzdopen'
./debug\quagzipfile.o: In function `ZN11QuaGzipFile5flushEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:149: undefined reference to `gzflush'
./debug\quagzipfile.o: In function `ZN11QuaGzipFile5closeEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:155: undefined reference to `gzclose'
./debug\quagzipfile.o: In function `ZN11QuaGzipFile8readDataEPcx':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:160: undefined reference to `gzread'
./debug\quagzipfile.o: In function `ZN11QuaGzipFile9writeDataEPKcx':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quagzipfile.cpp:167: undefined reference to `gzwrite'
./debug\quaziodevice.o: In function `ZN12QuaZIODevice4openE6QFlagsIN9QIODevice12OpenModeFlagEE':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:157: undefined reference to `inflateInit_'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:163: undefined reference to `deflateInit_'
./debug\quaziodevice.o: In function `ZN12QuaZIODevice5closeEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:174: undefined reference to `inflateEnd'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:180: undefined reference to `deflateEnd'
./debug\quaziodevice.o: In function `ZN12QuaZIODevice8readDataEPcx':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:208: undefined reference to `inflate'
./debug\quaziodevice.o: In function `ZN12QuaZIODevice9writeDataEPKcx':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:264: undefined reference to `deflate'
./debug\quaziodevice.o: In function `ZN12QuaZIODevice5flushEv':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/quaziodevice.cpp:300: undefined reference to `deflate'
./debug\unzip.o: In function `unzOpenCurrentFile3':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:1592: undefined reference to `inflateInit2_'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:1627: undefined reference to `get_crc_table'
./debug\unzip.o: In function `unzReadCurrentFile':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:1792: undefined reference to `crc32'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:1856: undefined reference to `inflate'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:1867: undefined reference to `crc32'
./debug\unzip.o: In function `unzCloseCurrentFile':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/unzip.c:2030: undefined reference to `inflateEnd'
./debug\zip.o: In function `zipOpenNewFileInZip4_64':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1259: undefined reference to `deflateInit2_'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1287: undefined reference to `get_crc_table'
./debug\zip.o: In function `zipWriteInFileInZip':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1454: undefined reference to `crc32'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1513: undefined reference to `deflate'
./debug\zip.o: In function `zipCloseFileInZipRaw64':
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1577: undefined reference to `deflate'
D:\EVAL 4dev\EVAL_4dev_Client\Phenix\build-quazip-Desktop-Debug\quazip/../../quazip-0.7.3/quazip/zip.c:1619: undefined reference to `deflateEnd'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [debug\quazipd.dll] Error 1
mingw32-make[1]: *** [debug] Error 2
mingw32-make: *** [sub-quazip-make_first] Error 2

Provide SHA512 and SHA256 checksums

Description

Provide SHA512 and SHA256 checksums for all files both on GitHub in the releases section and SourceForge in files section. All in plaintext so users don't need to download the checksum which would defeat the whole purpose of them.

PS Both MD5 and SHA1 are breaked and shouldn't be provided because they give a false sense of security.

Expected Behavior

After downloading the file I should be able to verify if the file I have is the same as the one uploaded by the maintainers.

Current Behavior

Users can't verify the downloaded files.

Steps to Reproduce

  1. Download an installer.
  2. An attacker intercepts the file and swaps it with a modified malicious one.
  3. Don't verify the file because there are no checksums.
  4. Get f... hacked. (couldn't resist)

New release

Hi,

could you, please, make a new release with the latest updates to the code?

Thanks

Writing zip stream to a socket

Hello, I apologize for crossing threads previously.

I would like to write zip data to a network stream/socket.

What I have so far:

QBuffer _zipBuffer;	
QuaZIODevice _zipDevice(&_zipBuffer);
QuaZip _zipObject(&_zipDevice);

QuaZipFile _zipFile(&_zipObject);
QString f2("some/path/to/a/file.txt");

if (! (	_zipObject.open(QuaZip::mdCreate)	&&
		_zipDevice.open(QIODevice::WriteOnly)	&&
		_zipBuffer.open(QIODevice::ReadWrite)	&&
		_zipFile.open(QIODevice::WriteOnly, QuaZipNewInfo(f2))
{
	//device(s) could not be opened, report an error
}
else
{
	//device is open, fetch data
	fetchDataChunk();
}

//...

//then after fetchDataChunk() returns with data...

_zipDevice.write( qbytearraydata );
//_zipFile.write( qbytearraydata );	//makes sense, but doesn't work

//...

//then after issuing a request for more data or knowing that there is no more data...

_zipBuffer.seek(0);
QByteArray data = _zipBuffer.readAll();
_socket.write(data);

I'm getting data back from the buffer, but saving the data to file (using curl, for instance) results in an invalid zip file.

I feel like I'm missing something here, and have had trouble figuring it out.

Consider creating a portfile for vcpkg

vcpkg (https://github.com/microsoft/vcpkg) is another C++ library/package manager that is quite popular at the moment.

Please consider creating a portfile for QuaZIP in vcpkg repository. A port file is more or less just a cmake script. Unfortunately I have only limited knowledge of cmake, therefore I am not able to contribute that port file by myself at the moment (maybe next year).

Making QuaZIP accessible via vcpkg would make it accessible to a lot of people.

Building on Windows with Cmake and looking at Conan

I am about to try to update your CMakeLists.txt file to use Conan ( a C++ package manager www.conan.io )

But before I get started, is zlib/1.2.11 adequate?

Looking to build for MSVS 2015, Qt 5.9,X and 5.12, and maybe MSVS 2012.

If you are interested in my final CMakeLists.txt it is yours.

UTF-8 is not properly supported, even if choosen as file name encoding

Currently, there is no proper support in QuaZIP for UTF-8 encoding in file names and comments in ZIP archive. On Windows, file names and comments (text-names hereon) are encoded in local OEM encoding, which easily leads to information loss. At the same time, changes in ZIP file format enabling the use of UTF-8 encoding were implemented back in 2006, and according to my tests, are supported by standard tools both on Windows (starting from Windows 7 SP1) and MacOS (at least on El Capitan 10.11). ZIP file format is documented here: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT. Proposed fix to this issue changes QuaZIP library in a way that it always creates archives with text-names encoded in UTF-8, and decodes text from UTF-8 if corresponding flag is detected in ZIP header. If no UTF-8 flag is detected, the behavior is unchanged (converting to Unicode using QTextCodec from current locale).

See pull request #17.

Compilation error, windows 10, QT 5.11

I can not compile the library. Used this article https://www.antonioborondo.com/zipping-and-unzipping-files-with-qt/. Zlib compiles normally, and at the stage of the assembly, Quazip gets the following error.

./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0xd2d): undefined reference to _imp___ZNK16QuaZipFileInfo6412getNTFSmTimeEPi'
./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x10ce): undefined reference to _imp___ZN10QuaZipFileD1Ev' ./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x10d7): undefined reference to _imp___ZN6QuaZipD1Ev'
./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x16a8): undefined reference to _imp___ZNK16QuaZipFileInfo6412getNTFSaTimeEPi' ./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x171f): undefined reference to _imp___ZNK16QuaZipFileInfo6412getNTFScTimeEPi'
./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x1a35): undefined reference to _imp___ZN10QuaZipFileD1Ev' ./.obj\testquazipfileinfo.o:testquazipfileinfo.cpp:(.text+0x1a3e): undefined reference to _imp___ZN6QuaZipD1Ev'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:118: recipe for target 'release\qztest.exe' failed
mingw32-make[2]: *** [release\qztest.exe] Error 1
mingw32-make[2]: Leaving directory 'E:/Qt/quazip-0.7.6/qztest'
Makefile:36: recipe for target 'release' failed
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory 'E:/Qt/quazip-0.7.6/qztest'
Makefile:66: recipe for target 'sub-qztest-make_first' failed
mingw32-make: *** [sub-qztest-make_first] Error 2`

QuaZipFile's destructor in the stack will crash.

Simple TEST CASE(debug mode use release dll):

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    {
        QuaZipFile analysisFile("D:/PROGRAMMING/SightPro/fileMgr/fmTest/TestData/2020-07-21_1C19-probe.expzip", "run.exp");
    }
    return a.exec();
}

WinNT executable (MinGW) ?

Hi,

this is interesting, can you upload an executable for WinNT in our releases ?
can be maybe a interesting thing for reactos.org ?
The zipfolder be already implement, like i become with,
but as cmd option maybe also interesting ..
is there maby a possible to implement a possible for creating iso's,
something maybe also packing in .. quazip -iso [folder] or quazip -x folder.iso ./tofolder

just as idea .. maybe more options in a single exe more better as only one purpose ;)

best regards
Blacky

Linkage errors on Windows and Qt 5.14

First I cloned zlib and build it:

sh configure --prefix=../
if [[ -f "gzguts.h" ]]; then # see https://github.com/madler/zlib/issues/268 and  https://stackoverflow.com/a/44198746/10162645
   sed -i 's/defined(_WIN32) || defined(__CYGWIN__)/defined(_WIN32)/g' gzguts.h
   sed -i 's/gzopen_w//g' win32/zlib.def
fi
export BINARY_PATH=../bin
export INCLUDE_PATH=../include
export LIBRARY_PATH=../lib
make install -fwin32/Makefile.gcc SHARED_MODE=1

Than I cloned quazip and run:

C:\Qt\5.14.2\mingw73_64\bin\qmake.exe "LIBS+=-L./zlib_windows/bin -lzlib1" "INCLUDEPATH += ./zlib_windows/include" PREFIX=../dist
make

and got the following error:

...
g++ -Wl,-s -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,release/libQt5Quazip1.a -o release/Qt5Quazip1.dll @object_script.Qt5Quazip.Release  C:/Qt/5.14.2/mingw73_64/lib/libQt5Core.a release/Qt5Quazip_resource_res.o
release/JlCompress.o:JlCompress.cpp:(.text+0xc3): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0xc3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x2ef): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x2ef): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x30a): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x30a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x31c): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x31c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x3de): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x3de): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x6af): more undefined references to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' follow
release/JlCompress.o:JlCompress.cpp:(.text+0x6af): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x6c4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x6d6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x6eb): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0x700): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/JlCompress.o:JlCompress.cpp:(.text+0xb7c): additional relocation overflows omitted from the output
release/quaadler32.o:quaadler32.cpp:(.text+0x20): undefined reference to `adler32'
release/quaadler32.o:quaadler32.cpp:(.text+0x4c): undefined reference to `adler32'
release/quaadler32.o:quaadler32.cpp:(.text+0x5a): undefined reference to `adler32'
release/quaadler32.o:quaadler32.cpp:(.text+0x8a): undefined reference to `adler32'
release/quaadler32.o:quaadler32.cpp:(.text+0xbd): undefined reference to `adler32'
release/quacrc32.o:quacrc32.cpp:(.text+0x20): undefined reference to `crc32'
release/quacrc32.o:quacrc32.cpp:(.text+0x4c): undefined reference to `crc32'
release/quacrc32.o:quacrc32.cpp:(.text+0x5a): undefined reference to `crc32'
release/quacrc32.o:quacrc32.cpp:(.text+0x8a): undefined reference to `crc32'
release/quacrc32.o:quacrc32.cpp:(.text+0xbd): undefined reference to `crc32'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x39): undefined reference to `gzopen'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x71): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x99): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x262): undefined reference to `gzflush'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x27d): undefined reference to `gzread'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x2aa): undefined reference to `gzwrite'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x388): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x3b3): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x47b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x521): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x554): undefined reference to `gzclose'
release/quagzipfile.o:quagzipfile.cpp:(.text+0xc6): undefined reference to `gzdopen'
release/quagzipfile.o:quagzipfile.cpp:(.text+0x4cb): undefined reference to `gzclose'
release/quagzipfile.o:quagzipfile.cpp:(.text$_ZN18QuaGzipFilePrivate4openI7QStringEEbT_6QFlagsIN9QIODevice12OpenModeFlagEERS1_[_ZN18QuaGzipFilePrivate4openI7QStringEEbT_6QFlagsIN9QIODevice12OpenModeFlagEERS1_]+0xcd): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quagzipfile.o:quagzipfile.cpp:(.text$_ZN18QuaGzipFilePrivate4openIiEEbT_6QFlagsIN9QIODevice12OpenModeFlagEER7QString[_ZN18QuaGzipFilePrivate4openIiEEbT_6QFlagsIN9QIODevice12OpenModeFlagEER7QString]+0x3a): undefined reference to `gzdopen'
release/quagzipfile.o:quagzipfile.cpp:(.text$_ZN18QuaGzipFilePrivate4openIiEEbT_6QFlagsIN9QIODevice12OpenModeFlagEER7QString[_ZN18QuaGzipFilePrivate4openIiEEbT_6QFlagsIN9QIODevice12OpenModeFlagEER7QString]+0xcc): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x1cd): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x267): undefined reference to `deflate'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x2f8): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x36b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x4f5): undefined reference to `inflate'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x598): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x81a): undefined reference to `deflate'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x895): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x8ef): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0x9ca): undefined reference to `deflateInit_'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xa29): undefined reference to `inflateInit_'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xad5): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xb50): undefined reference to `inflateEnd'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xb84): undefined reference to `deflateEnd'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xc04): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quaziodevice.o:quaziodevice.cpp:(.text+0xc73): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quazip.o:quazip.cpp:(.text+0x53): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quazip.o:quazip.cpp:(.text+0x119): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quazip.o:quazip.cpp:(.text+0x134): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
release/quazip.o:quazip.cpp:(.text+0x14a): more undefined references to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' follow
release/unzip.o:unzip.c:(.text+0x1dab): undefined reference to `crc32'
release/unzip.o:unzip.c:(.text+0x1e07): undefined reference to `inflate'
release/unzip.o:unzip.c:(.text+0x1e52): undefined reference to `crc32'
release/unzip.o:unzip.c:(.text+0x1f54): undefined reference to `crc32'
release/unzip.o:unzip.c:(.text+0x21a7): undefined reference to `inflateEnd'
release/unzip.o:unzip.c:(.text+0x2629): undefined reference to `get_crc_table'
release/unzip.o:unzip.c:(.text+0x28b9): undefined reference to `inflateInit2_'
release/zip.o:zip.c:(.text+0x15c4): undefined reference to `crc32'
release/zip.o:zip.c:(.text+0x169f): undefined reference to `deflate'
release/zip.o:zip.c:(.text+0x1a53): undefined reference to `deflateEnd'
release/zip.o:zip.c:(.text+0x1af3): undefined reference to `deflate'
release/zip.o:zip.c:(.text+0x1b5a): undefined reference to `deflateEnd'
release/zip.o:zip.c:(.text+0x1d86): undefined reference to `deflateEnd'
release/zip.o:zip.c:(.text+0x1df8): undefined reference to `deflateEnd'
release/zip.o:zip.c:(.text+0x2678): undefined reference to `deflateInit2_'
release/zip.o:zip.c:(.text+0x26af): undefined reference to `get_crc_table'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.Release:127: release/Qt5Quazip1.dll] Error 1
make[2]: Leaving directory '/c/Users/Leander Schulten/git_projects/Lichtsteuerung.git/src/lib/quazip/quazip/quazip'
make[1]: *** [Makefile:45: release] Error 2
make[1]: Leaving directory '/c/Users/Leander Schulten/git_projects/Lichtsteuerung.git/src/lib/quazip/quazip/quazip'
make: *** [Makefile:51: sub-quazip-make_first] Error 2

I tried it with DEFINES += ZLIB_WINAPI and without.

Something is wrong with the include files causing builds to fail

/usr/include/quazip5/crypt.h:37:53: error: unknown type name 'z_crc_t'
static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab UNUSED)
                                                    ^
/usr/include/quazip5/crypt.h:37:65: error: expected ')'                                                          
static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab UNUSED)
                                                                ^
/usr/include/quazip5/crypt.h:37:24: note: to match this '('                                                      
static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab UNUSED)
                       ^
/usr/include/quazip5/crypt.h:51:51: error: unknown type name 'z_crc_t'                                           
static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c)
                                                  ^
/usr/include/quazip5/crypt.h:51:63: error: expected ')'                                                          
static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c)
                                                              ^
/usr/include/quazip5/crypt.h:51:23: note: to match this '('                                                      
static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c)
                      ^
/usr/include/quazip5/crypt.h:53:20: error: use of undeclared identifier 'pcrc_32_tab'                            
    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
                   ^
/usr/include/quazip5/crypt.h:32:25: note: expanded from macro 'CRC32'                                            
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
                        ^
/usr/include/quazip5/crypt.h:53:40: error: use of undeclared identifier 'c'                                      
    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
                                       ^
/usr/include/quazip5/crypt.h:57:7: warning: 'register' storage class specifier is deprecated and incompatible    
      with C++17 [-Wdeprecated-register]
      register int keyshift = (int)((*(pkeys+1)) >> 24);
      ^~~~~~~~~
/usr/include/quazip5/crypt.h:58:22: error: use of undeclared identifier 'pcrc_32_tab'                            
      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
                     ^
/usr/include/quazip5/crypt.h:32:25: note: expanded from macro 'CRC32'                                            
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
                        ^
/usr/include/quazip5/crypt.h:60:12: error: use of undeclared identifier 'c'                                      
    return c;
           ^
/usr/include/quazip5/crypt.h:68:69: error: unknown type name 'z_crc_t'                                           
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab)
                                                                    ^
/usr/include/quazip5/crypt.h:68:81: error: expected ')'                                                          
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab)
                                                                                ^
/usr/include/quazip5/crypt.h:68:22: note: to match this '('                                                      
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab)
                     ^
/usr/include/quazip5/crypt.h:74:27: error: use of undeclared identifier 'pcrc_32_tab'                            
        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
                          ^
1 warning and 11 errors generated.             

Suggestion: Update cmake files to "modern cmake"

The cmake files require a very old version of cmake (2.8.5 from 2011) and this makes it difficult to use within other projects. Right now it cannot directly be included as a subdirectory and we must write our own cmake file for it.

I would suggest moving to a more recent version of cmake (3.8+) and to use targets properly so it's easier to add to projects.

TestQuaZipFileInfo::getNTFSTime() test fails on Linux

When running the test suite on Linux (KDE Neon/Ubuntu 18.04), the TestQuaZipFileInfo test fails with the following msg:

********* Start testing of TestQuaZipFileInfo *********
Config: Using QtTest library 5.14.1, Qt 5.14.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.4.0)
PASS : TestQuaZipFileInfo::initTestCase()
FAIL! : TestQuaZipFileInfo::getNTFSTime() Compared values are not the same
Actual (zipFileInfo.getNTFScTime()): 1601/01/01 00:00:00.000[UTC]
Expected (fileInfo.birthTime())

How decompress/compress a docx-file successfully without warning of corruption?

I want to extract a docx file (zipfile = docx-file) and compress it with modifications new. But when I opened the new compressed docx file without change (only decompress and then compress) then I get a corruption warning.

What I must do to decompress/compress with quazip a docx file successfully without warning of corruption?

Here my methods:

void smaZip(QString zipfile , QString zipdir)
{
if(JlCompress::compressDir(zipfile, zipdir))
{
qDebug() << "compressing success!" << endl;
} else {
qDebug() << "compressing not successful!" << endl;
}

}

void smaUnZip(QString zipfile , QString zipdir)
{
QStringList list = JlCompress::extractDir(zipfile, zipdir);

foreach(QString item, list)
{
    qDebug() << "extracted file: " << item << endl;
}

}

Very thank you for your help.

Greetings,
Sven

quazip password protect an archive

Hello, I hope it's the good place to ask this, because I'm new on Github and I'm not sure where to ask this.

I've imported QuaZip in my Qt project and I can easily compress a folder including files to zip.
Now I'd like to protect this zip file with a password but I don't find the solution.

Could you please tell me if it's possible?
Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.