我正在尝试在安装了 Qt 5.0.1 32 位 LGPL 的 Windows 7(32 位)上构建 quazip 库(版本 0.5.1)。
当我在 Qt 命令提示符下运行时:
qmake
mingw32-make
将目录设置为我提取 Quazip 的文件夹 (C:\Qt\quazip-0.5.1\quazip) 时,我收到以下错误日志:
C:\Qt\quazip-0.5.1\quazip>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Qt/quazip-0.5.1/quazip'
g++ -Wl,-s -shared -mthreads -Wl,--out-implib,release\libquazip.a -o release\qua
zip.dll object_script.quazip.Release -LC:\Qt\Qt5\5.0.1\mingw47_32\lib -lQt5Core
./release\unzip.o:unzip.c:(.text+0x1008): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x10aa): undefined reference to `inflate'
./release\unzip.o:unzip.c:(.text+0x10da): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1110): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1327): undefined reference to `inflateEnd'
./release\unzip.o:unzip.c:(.text+0x1727): undefined reference to `get_crc_table'
./release\unzip.o:unzip.c:(.text+0x186f): undefined reference to `inflateInit2_'
./release\zip.o:zip.c:(.text+0xac7): undefined reference to `crc32'
./release\zip.o:zip.c:(.text+0xb7c): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xcdf): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xef5): undefined reference to `deflateEnd'
./release\zip.o:zip.c:(.text+0x13a8): undefined reference to `get_crc_table'
./release\zip.o:zip.c:(.text+0x1af9): undefined reference to `deflateInit2_'
./release\quaadler32.o:quaadler32.cpp:(.text+0x2e): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0x61): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xa1): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xb1): undefined reference to `adle
r32'
c:/qt/qt5/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64
-mingw32/bin/ld.exe: ./release\quaadler32.o: bad reloc address 0x0 in section `.
rdata$_ZTI13QuaChecksum32[__ZTI13QuaChecksum32]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:106: recipe for target 'release\quazip.dll' failed
mingw32-make[1]: *** [release\quazip.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/quazip-0.5.1/quazip'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
但在我的 Zlib-Folder (C:\Qt\Qt5\5.0.1\Src\qtbase\src\3rdparty\zlib) 中,所有列出的文件都已安装。
.
当我尝试解决该问题时,我已添加到 quazip.pro 和 quazip.pri 中:
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
,如何建议here https://stackoverflow.com/questions/4449467/how-to-compile-and-use-quazip-on-windows-do-i-need-to-separately-install-zlib.
到目前为止我在谷歌上找到的所有其他解决方案都没有帮助。
我希望你们中有人能帮助我。
问候,
左室电压
问题是 QuaZIP 找不到 zlib 库。运行 qmake 时,您应该包含标头和库的路径:
qmake "INCLUDEPATH+=C:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib" "LIBS+=-LC:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib -lz"
mingw32-make
如果你想查看的话,我的博客中有完整的解释:http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/ http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)