Can’t Install QuaZip / zLib on QT 5.11.2 (MSVC 2015, 32 bit)



  • OS: Windows 10
    QT 5.11.2
    QT Creator 4.7.1

    Hello! I have been trying for days to implement and use QuaZip in QT. I will need some help. Here is what I have done.

    1. I followed this tutorial: https://www.youtube.com/watch?v=9JkHMmIeSNk (i dont speak spanish but he shows it step-by-step)

    2. I start by downloading QuaZip (quazip-0.7.3): https://sourceforge.net/projects/quazip/ and places it on Desktop.

    3. In the video the instructor navigates to his QT folder → Qt5.4.1 → 5.4 → Src → qtbase → src → 3rdparty → zlib. He copies the zlib folder to the Desktop, opens a cmd terminal and navigates to the zlib folder. He types ”qmake -project” to generate a .pro file. He opens the zlib.pro file in QT and builds a zlib.dll file.

    My problems regarding step 3: I dont have a Src | qtbase | src | 3rdparty | zlib folder in my QT installation so I need to retrieve the zlib.dll elsewhere. I go here: http://gnuwin32.sourceforge.net/packages/zlib.htm and download Binaries Zip. I extract the zip to my Desktop.

    Now I have the following folders on my Desktop:

    • quazip-0.7.3
    • zlib-1.2.3-bin

    The zlib-1.2.3-bin includes /bin/zlib1.dll. I learned that zlib1.dll is the new version of zlib.dll

    1. I rename my zlib-1.2.3-bin folder to zlib. In the zlib folder i have two subfolders: lib and include.

    2. I notice the instructor moves the following files to the zlib/include folder:

    crc32.h
    deflate.h
    gzguts.h
    inffast.h
    inffixed.h
    inflate.h
    inftrees.h
    trees.h
    zconf.h
    zlib.h
    zutil.h

    I dont have these files to i download them here: https://zlib.net/ and move them to the zlib/include.

    1. The instructor moves his zlib.dll file to zlib/lib. I move my zlib1.dll to my zlib/lib.

    2. I go to quazip-0.7.3 folder → /quazip → double-click quazip.pro and QT Creator opens.

    3. Just like the instructor I open up quazip.pro in QT Creator and goes to the bottom of the file. I also add:

    INCLUDEPATH += ”C:/Users/Damien/Desktop/zlib/include”
    LIBS += -L”C:/Users/Damien/Desktop/zlib/lib”
    LIBS += -lzlib1

    For him it all compiles well. I get error message: :-1: error: LNK1104: cannot open file 'zlib1.lib'

    And it is true. I dont have a zlib1.lib file. I have a zlib1.dll file. How can I proceed?

    Please explain simply in steps. Thanks!



  • I made a bit easier to understand by uploading a video of my issue: https://vimeo.com/296186309 Thank you!


  • Lifetime Qt Champion

    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.


  • Qt Champions 2017

    @RobinQT

    As @SGaist said, you need to additionally install the source code for your Qt version. you can do this with the online installer/MaintenanceTool you used to install Qt.

    Regards



  • 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 externals

    How can I fix this issue? Thanks.

    Here is the zlib.pro file: https://pastebin.com/jVPNL8qV


  • Qt Champions 2017

    @RobinQT

    I think you didn't change TEMPLATE=app to TEMPLATE=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.


  • Qt Champions 2017

    @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.stash

    This 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 found

    I 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 += -lzlib

    It 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 directory

    This, 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.