Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104728

Bundled zlib collides with the latest zlib version in a static build

    XMLWordPrintable

Details

    Description

      Using zlib v1.2.12 in a Qt project results in a collision with the bundled zlib:

       

      Qt5Core.lib(crc32.obj) : error LNK2005: crc32_combine_gen already defined in zlibstatic.lib(crc32.obj)
      Qt5Core.lib(crc32.obj) : error LNK2005: crc32_combine_gen64 already defined in zlibstatic.lib(crc32.obj)
      Qt5Core.lib(crc32.obj) : error LNK2005: crc32_combine_op already defined in zlibstatic.lib(crc32.obj)
      

      Example:

       

      #include <QCoreApplication>
      #include <zlib.h>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          crc32_combine_gen(0);
      
          return a.exec();
      }
      
      

      This problem seems to be introduced by the commit 8975b7c2b0f9bbe45fa3e3f68fea075a9ce4d525 and reverting it fixed the problem.

       

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              miikapernu Miika Pernu
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes