Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Can’t Install QuaZip / zLib on QT 5.11.2 (MSVC 2015, 32 bit)
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
12 Posts 3 Posters 8.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #3

    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.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    2
    • RobinQTR Offline
      RobinQTR Offline
      RobinQT
      wrote on last edited by RobinQT
      #4

      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.

      aha_1980A 1 Reply Last reply
      0
      • RobinQTR RobinQT

        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.

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #5

        @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

        Qt has to stay free or it will die.

        1 Reply Last reply
        2
        • RobinQTR Offline
          RobinQTR Offline
          RobinQT
          wrote on last edited by RobinQT
          #6

          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

          aha_1980A 1 Reply Last reply
          0
          • RobinQTR RobinQT

            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

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #7

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

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • RobinQTR Offline
              RobinQTR Offline
              RobinQT
              wrote on last edited by RobinQT
              #8

              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.

              aha_1980A 1 Reply Last reply
              0
              • RobinQTR RobinQT

                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.

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #9

                @RobinQT did you re-run qmake (without -project)?

                Qt has to stay free or it will die.

                1 Reply Last reply
                0
                • RobinQTR Offline
                  RobinQTR Offline
                  RobinQT
                  wrote on last edited by
                  #10

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

                  1 Reply Last reply
                  0
                  • RobinQTR Offline
                    RobinQTR Offline
                    RobinQT
                    wrote on last edited by
                    #11

                    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

                    1 Reply Last reply
                    0
                    • RobinQTR Offline
                      RobinQTR Offline
                      RobinQT
                      wrote on last edited by RobinQT
                      #12

                      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.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved