Unsolved Can’t Install QuaZip / zLib on QT 5.11.2 (MSVC 2015, 32 bit)
-
Hi and welcome to devnet,
If you want to follow the original guide, you first have to download Qt's sources. You can use the installer you already used to install Qt on your machine for that.
-
Hello @SGaist. Thank you for your reply.
I already have QT installed on my machine. Could you explain further? Are there options in the original QT installer which allows me to directly implement QuaZip? Thanks.
-
-
Alright! There has been some progress. But I still face a few challenges. I will repeat my steps to help others in same situation:
I did as @aha_1980 and @SGaist mention. I navigated to: "C:\Qt\MaintenceTool.exe" and installed the source code. The zlib folder appeared! I went back to the tutorial and got stuck at this part: https://youtu.be/9JkHMmIeSNk?t=117
I dont use mingw491_32 but Qt 5.11.2 64-bit for Desktop (MSVC 2015). When I ran the command: "qmake -project" in the zlib folder I got an cl.exe related error: "Maybe you forgot to setup the environment?". In order to fix this I added the system variable path:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat
I also navigated to this folder (using Qt 5.11.2 64-bit for Desktop (MSVC 2015)) and invoked vsdevcmd.bat then I typed cl.exe and ensured that it was running. From the same command-window I navigated to my zlib folder and typed: "qmake -project" and it actually worked!
I follow the video-tutorial, but this time I get the following error messages trying to build zlib:
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflate already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflateEnd already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflateInit_ already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_adler32 already defined in adler32.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_crc32 already defined in crc32.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_gzclose_r already defined in gzread.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_gzclose_w already defined in gzwrite.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_inflate already defined in inflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_inflateEnd already defined in inflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_inflateReset already defined in inflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_inflateInit2_ already defined in inflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflateReset already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflateParams already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_deflateInit2_ already defined in deflate.obj
Qt5Core.lib(Qt5Core.dll):-1: error: LNK2005: z_inflateInit_ already defined in inflate.obj
qtmain.lib(qtmain_win.obj):-1: error: LNK2019: unresolved external symbol main referenced in function WinMain
release\zlib.exe:-1: error: LNK1120: 1 unresolved externalsHow can I fix this issue? Thanks.
Here is the zlib.pro file: https://pastebin.com/jVPNL8qV
-
I think you didn't change
TEMPLATE=app
toTEMPLATE=lib
.He also tells about the "muliple main" error, seems you have it too.
-
True @aha_1980
I did change TEMPLATE=app to TEMPLATE=lib now but the errors mentioned in the earlier post still occurs. The main errors he avoid by commenting out: minigzip.c However I do not have that one as shown in the pastebin. Thank you for the reply.
-
@RobinQT did you re-run qmake (without -project)?
-
@aha_1980 I did re-run qmake with the -project argument now. The console gave me the following message:
C:\Users\Damien\Desktop\zlib>qmake
Info: creating stash file C:\Users\Damien\Desktop\zlib.qmake.stashThis is the stash file: https://pastebin.com/AreSQHJ1
There is still the same error messages. But the bottom below ones is replaced with the following:
release\zlib.dll:-1: error: LNK1169: one or more multiply defined symbols foundI also see the following folder has been created in my desktop: build-zlib-Desktop_Qt_5_11_2_MSVC2015_64bit-Release
I am very happy about that. However, I am worried about the error messages in QT still. Thanks.
-
I tried to open quazip.pro now and add the following lines in the bottom (once again):
INCLUDEPATH += ”C:/Users/Damien/Desktop/zlib/include”
LIBS += -L”C:/Users/Damien/Desktop/zlib/lib”
LIBS += -lzlibIt does not complain about not finding zlib.lib because it was compiled and I moved it there. However QT gives me the following messages:
C:\Users\Damien\Desktop\quazip\quazip\qioapi.cpp:15: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\quacrc32.cpp:27: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\zip.h:56: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\zip.h:56: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\quagzipfile.h:31: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\quaziodevice.h:31: error: C1083: Cannot open include file: 'zlib.h': No such file or directory
C:\Users\Damien\Desktop\quazip\quazip\zip.h:56: error: C1083: Cannot open include file: 'zlib.h': No such file or directoryThis, eventho, there is a zlib.h in C:\Users\Damien\Desktop\zlib\include\zlib.h but remember quazip.pro is opened from C:\Users\Damien\Desktop\quazip\quazip which is a different folder. I tried moving zlib.h from zlib folder to quazip folder, but it wouldnt help
-
So, the issues was me using special quotes instead of the normal one. It does find zlib.lib now but I get the following errors still: https://pastebin.com/8WZpi2aH
quaadler32.obj:-1: error: LNK2019: unresolved external symbol adler32 referenced in function "public: __cdecl QuaAdler32::QuaAdler32(void)" (??0QuaAdler32@@QEAA@XZ) quacrc32.obj:-1: error: LNK2019: unresolved external symbol crc32 referenced in function "public: __cdecl QuaCrc32::QuaCrc32(void)" (??0QuaCrc32@@QEAA@XZ) unzip.obj:-1: error: LNK2001: unresolved external symbol crc32 zip.obj:-1: error: LNK2001: unresolved external symbol crc32 quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzdopen referenced in function "private: bool __cdecl QuaGzipFilePrivate::open<int>(int,class QFlags<enum QIODevice::OpenModeFlag>,class QString &)" (??$open@H@QuaGzipFilePrivate@@AEAA_NHV?$QFlags@W4OpenModeFlag@QIODevice@@@@AEAVQString@@@Z) quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzread referenced in function "protected: virtual __int64 __cdecl QuaGzipFile::readData(char *,__int64)" (?readData@QuaGzipFile@@MEAA_JPEAD_J@Z) quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzwrite referenced in function "protected: virtual __int64 __cdecl QuaGzipFile::writeData(char const *,__int64)" (?writeData@QuaGzipFile@@MEAA_JPEBD_J@Z) quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzflush referenced in function "public: virtual bool __cdecl QuaGzipFile::flush(void)" (?flush@QuaGzipFile@@UEAA_NXZ) quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzclose referenced in function "public: virtual __cdecl QuaGzipFile::~QuaGzipFile(void)" (??1QuaGzipFile@@UEAA@XZ) quagzipfile.obj:-1: error: LNK2019: unresolved external symbol gzopen referenced in function "private: bool __cdecl QuaGzipFilePrivate::open<class QString>(class QString,class QFlags<enum QIODevice::OpenModeFlag>,class QString &)" (??$open@VQString@@@QuaGzipFilePrivate@@AEAA_NVQString@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@AEAV1@@Z) quaziodevice.obj:-1: error: LNK2019: unresolved external symbol deflate referenced in function "public: virtual bool __cdecl QuaZIODevice::flush(void)" (?flush@QuaZIODevice@@UEAA_NXZ) zip.obj:-1: error: LNK2001: unresolved external symbol deflate quaziodevice.obj:-1: error: LNK2019: unresolved external symbol deflateEnd referenced in function "public: virtual void __cdecl QuaZIODevice::close(void)" (?close@QuaZIODevice@@UEAAXXZ) zip.obj:-1: error: LNK2001: unresolved external symbol deflateEnd 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) unzip.obj:-1: error: LNK2001: unresolved external symbol inflate quaziodevice.obj:-1: error: LNK2019: unresolved external symbol inflateEnd referenced in function "public: virtual void __cdecl QuaZIODevice::close(void)" (?close@QuaZIODevice@@UEAAXXZ) unzip.obj:-1: error: LNK2001: unresolved external symbol inflateEnd 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 inflateInit_ referenced in function "public: virtual bool __cdecl QuaZIODevice::open(class QFlags<enum QIODevice::OpenModeFlag>)" (?open@QuaZIODevice@@UEAA_NV?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z) unzip.obj:-1: error: LNK2019: unresolved external symbol inflateInit2_ referenced in function unzOpenCurrentFile3 unzip.obj:-1: error: LNK2019: unresolved external symbol get_crc_table referenced in function unzOpenCurrentFile3 zip.obj:-1: error: LNK2001: unresolved external symbol get_crc_table zip.obj:-1: error: LNK2019: unresolved external symbol deflateInit2_ referenced in function zipOpenNewFileInZip4_64 release\quazip.dll:-1: error: LNK1120: 17 unresolved externals
Thank you.