Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Inherited project with libzip.
QtWS25 Last Chance

Inherited project with libzip.

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 696 Views
  • 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.
  • Q Offline
    Q Offline
    QtUser17456
    wrote on 26 Jan 2024, 20:39 last edited by
    #1

    Hello,

    I have inherited a project in QT, but I struggle to build it.

    There is a reference to #include <zip.h> that is not resolved.
    The library I'm looking for is: Libzip from https://libzip.org/

    Trying to download packages, I end up here: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-libzip
    but not sure what to do with this.

    I use:
    Qt Creator 12.0.1
    with QT 6.6.1
    Windows 11

    From the CMakeLists.txt I see that it links "libzip-static.lib" and "libz-static.lib" but the folder referenced, is on the previous devs machines, I don't have those.

    I tried adding the sources of libzip to my project, but that fails as zipconf.h is missing.

    I tried all my googlefu, but could not find the answer. I did dive into MSYS2, and was able to install qt creator and libzip, but then I failed to setup a working kit.

    Any help or pointers in the right direction is appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Jan 2024, 20:58 last edited by
      #2

      Hi and welcome to devnet,

      zlib is using cmake as build system as does Qt 6 so you likely already have cmake in your machine as well. You can build the library on your machine to get the configuration you want.

      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
      1
      • Q Offline
        Q Offline
        QtUser17456
        wrote on 26 Jan 2024, 21:37 last edited by
        #3

        I have the QT installer taken care of installing dependencies.

        So cmake is at: "C:\Qt\Tools\CMake_64\bin\cmake.exe"

        I have used cmake-gui to fix the refences to zlib as described here: https://gist.github.com/davidcorbin/0b13604900089b8fcb28

        But now stuck on make. Where would I find that binary? It does not seem to be in the QT folder.

        S 1 Reply Last reply 26 Jan 2024, 21:48
        0
        • Q QtUser17456
          26 Jan 2024, 21:37

          I have the QT installer taken care of installing dependencies.

          So cmake is at: "C:\Qt\Tools\CMake_64\bin\cmake.exe"

          I have used cmake-gui to fix the refences to zlib as described here: https://gist.github.com/davidcorbin/0b13604900089b8fcb28

          But now stuck on make. Where would I find that binary? It does not seem to be in the QT folder.

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 26 Jan 2024, 21:48 last edited by
          #4

          @QtUser17456 just call cmake --build .

          There's no make on Windows. By default Qt 6 uses ninja which should also be installed.

          On Windows, you either have nmake for Visual Studio or mingw32-make for MinGW. Qt used to use jom to help parallelism on Windows.

          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
          1
          • Q Offline
            Q Offline
            QtUser17456
            wrote on 26 Jan 2024, 22:37 last edited by
            #5

            Thanks for your help! I am getting closer:
            C:\Users\User\Downloads\libzip-1.10.1.tar\libzip-1.10.1>cmake --build .
            [ 0%] Linking C shared library libzip.dll
            C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/Program Files (x86)/GnuWin32/lib: Permission denied
            collect2.exe: error: ld returned 1 exit status
            mingw32-make.exe[2]: *** [lib\CMakeFiles\zip.dir\build.make:2129: lib/libzip.dll] Error 1
            mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:216: lib/CMakeFiles/zip.dir/all] Error 2
            mingw32-make.exe: *** [Makefile:145: all] Error 2

            That location does exist, and I do run the command line elevated. I have double checked the permissions, they seem ok to me.

            S 1 Reply Last reply 27 Jan 2024, 20:34
            0
            • Q QtUser17456
              26 Jan 2024, 22:37

              Thanks for your help! I am getting closer:
              C:\Users\User\Downloads\libzip-1.10.1.tar\libzip-1.10.1>cmake --build .
              [ 0%] Linking C shared library libzip.dll
              C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find C:/Program Files (x86)/GnuWin32/lib: Permission denied
              collect2.exe: error: ld returned 1 exit status
              mingw32-make.exe[2]: *** [lib\CMakeFiles\zip.dir\build.make:2129: lib/libzip.dll] Error 1
              mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:216: lib/CMakeFiles/zip.dir/all] Error 2
              mingw32-make.exe: *** [Makefile:145: all] Error 2

              That location does exist, and I do run the command line elevated. I have double checked the permissions, they seem ok to me.

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 27 Jan 2024, 20:34 last edited by
              #6

              @QtUser17456 Don't ever build stuff as a super user.

              What does it look for in that folder ?

              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
              0
              • Q Offline
                Q Offline
                QtUser17456
                wrote on 28 Jan 2024, 13:04 last edited by
                #7

                Should have recognized this error earlier. I pointed to the folder instead of to the lib.

                With cmake-gui I now point to to the libfile: C:/Program Files (x86)/GnuWin32/lib/zlib.lib
                Both for release and debug.

                This is version 1.2.3 of zlib, checked by the dll version.

                Now the error is:
                [ 0%] Linking C shared library libzip.dll
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x2b0): undefined reference to deflateInit2_' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x2d7): undefined reference to inflateInit2_'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x33c): undefined reference to deflateEnd' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x351): undefined reference to inflateEnd'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x4a8): undefined reference to deflate' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x4c2): undefined reference to inflate'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_dirent.c.obj):zip_dirent.c:(.text+0x38a): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_error_strerror.c.obj):zip_error_strerror.c:(.text+0x137): undefined reference to zError'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_io_util.c.obj):zip_io_util.c:(.text+0x39d): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_pkware.c.obj):zip_pkware.c:(.text+0x29): undefined reference to crc32'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_pkware.c.obj):zip_pkware.c:(.text+0x7f): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_source_crc.c.obj):zip_source_crc:(.text+0xaf): undefined reference to crc32'
                C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_source_crc.c.obj):zip_source_crc:(.text+0x31d): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_string.c.obj):zip_string.c:(.text+0x1d): more undefined references to crc32' follow
                collect2.exe: error: ld returned 1 exit status
                mingw32-make.exe[2]: *** [lib\CMakeFiles\zip.dir\build.make:2129: lib/libzip.dll] Error 1
                mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:216: lib/CMakeFiles/zip.dir/all] Error 2
                mingw32-make.exe: *** [Makefile:145: all] Error 2

                What am I doing wrong? Can't I just get a precompiled package somewhere?

                J 1 Reply Last reply 28 Jan 2024, 14:21
                0
                • Q QtUser17456
                  28 Jan 2024, 13:04

                  Should have recognized this error earlier. I pointed to the folder instead of to the lib.

                  With cmake-gui I now point to to the libfile: C:/Program Files (x86)/GnuWin32/lib/zlib.lib
                  Both for release and debug.

                  This is version 1.2.3 of zlib, checked by the dll version.

                  Now the error is:
                  [ 0%] Linking C shared library libzip.dll
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x2b0): undefined reference to deflateInit2_' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x2d7): undefined reference to inflateInit2_'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x33c): undefined reference to deflateEnd' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x351): undefined reference to inflateEnd'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x4a8): undefined reference to deflate' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_algorithm_deflate.c.obj):zip_algorithm_deflate.c:(.text+0x4c2): undefined reference to inflate'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_dirent.c.obj):zip_dirent.c:(.text+0x38a): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_error_strerror.c.obj):zip_error_strerror.c:(.text+0x137): undefined reference to zError'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_io_util.c.obj):zip_io_util.c:(.text+0x39d): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_pkware.c.obj):zip_pkware.c:(.text+0x29): undefined reference to crc32'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_pkware.c.obj):zip_pkware.c:(.text+0x7f): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_source_crc.c.obj):zip_source_crc:(.text+0xaf): undefined reference to crc32'
                  C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_source_crc.c.obj):zip_source_crc:(.text+0x31d): undefined reference to crc32' C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\zip.dir/objects.a(zip_string.c.obj):zip_string.c:(.text+0x1d): more undefined references to crc32' follow
                  collect2.exe: error: ld returned 1 exit status
                  mingw32-make.exe[2]: *** [lib\CMakeFiles\zip.dir\build.make:2129: lib/libzip.dll] Error 1
                  mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:216: lib/CMakeFiles/zip.dir/all] Error 2
                  mingw32-make.exe: *** [Makefile:145: all] Error 2

                  What am I doing wrong? Can't I just get a precompiled package somewhere?

                  J Offline
                  J Offline
                  JonB
                  wrote on 28 Jan 2024, 14:21 last edited by
                  #8

                  @QtUser17456 said in Inherited project with libzip.:

                  C:/Program Files (x86)/GnuWin32/lib/zlib.lib

                  Only a though/possibility. Program Files (x86) is usually for 32-bit stuff under Windows 64-bit, but the rest of your compilation is/might be for 64-bit? Is this a 32-/64-bit mismatch?

                  1 Reply Last reply
                  1

                  3/8

                  26 Jan 2024, 21:37

                  topic:navigator.unread, 5
                  • Login

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