我是新手,正在尝试在 qt 5.5 下使用 Quazip。所以我刚刚从http://quazip.sourceforge.net/下载了项目源代码并打开了 .pro 文件。当我尝试构建项目时,我遇到了多个错误:
C1083: Cannot open include file: 'zlib.h': No such file or directory
为了避免在我刚刚安装的 Windows 上构建 zlib(从这里:http ://gnuwin32.sourceforge.net/packages/zlib.htm),C:\GnuWin32 中的 Windows 完整包。然后我在 .pro 文件中添加了这一行:
INCLUDEPATH += C:\GnuWin32\include
这产生了另一个错误:
Cannot open include file: 'unistd.h': No such file or directory
但是改变这条线
#if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */
解决了这个问题。
#if HAVE_UNISTD_H
不幸的是,现在我得到了 25 个未解析的外部符号,其中一些:
quaadler32.obj:-1: error: LNK2019: unresolved external symbol adler32 referenced in function "public: virtual unsigned int __cdecl QuaAdler32::calculate(class QByteArray const &)" (?calculate@QuaAdler32@@UEAAIAEBVQByteArray@@@Z)
quacrc32.obj:-1: error: LNK2019: unresolved external symbol crc32 referenced in function "public: virtual unsigned int __cdecl QuaCrc32::calculate(class QByteArray const &)" (?calculate@QuaCrc32@@UEAAIAEBVQByteArray@@@Z)
unzip.obj:-1: error: LNK2001: unresolved external symbol crc32
quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzopen referenced in function "private: void * __cdecl QuaGzipFilePrivate::open(class QString const &,char const *)" (?open@QuaGzipFilePrivate@@AEAAPEAXAEBVQString@@PEBD@Z)
quaziodevice.obj:-1: error: LNK2019: unresolved external symbol deflateInit_ referenced in function "public: virtual bool __cdecl QuaZIODevice::open(class QFlags<enum QIODevice::OpenModeFlag>)" (?open@QuaZIODevice@@UEAA_NV?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z)
quaziodevice.obj:-1: error: LNK2019: unresolved external symbol inflate referenced in function "protected: virtual __int64 __cdecl QuaZIODevice::readData(char *,__int64)" (?readData@QuaZIODevice@@MEAA_JPEAD_J@Z)
我尝试添加这一行:
LIBS += -LC:\GnuWin32\lib
但这并没有解决问题。在 Qt 下使用 Quazip 最简单的方法是什么?