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. [SOLVED] ZLib And QtCore
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] ZLib And QtCore

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 3.1k 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.
  • J Offline
    J Offline
    jpalbertini
    wrote on last edited by
    #1

    Hi everyone,

    I'm trying to build a static version of Qt 5.2 (developper, opensource, msvc2010, no exemples, no tests, OpenGL desktop), which i succeeded but when i try to link it with my application which use other frameworks, the build fail with a linker error:

    Qt5Cored.lib(zutil.obj) : error LNK2005: _z_errmsg already defined in...

    So i tried to use the -no-zlib switch but it does not seems no work as the Library is set to:
    ZLIB support............qt

    What can i do to remove this lib from qtcore ? I heard that the -system-zlib does not work on Windows so i haven't tried it yet ...

    Thanks for the reply :)

    1 Reply Last reply
    0
    • P Offline
      P Offline
      patrik08
      wrote on last edited by
      #2

      Hi .. can you post the full argument after configure?...
      I know the QtCore need zlib for many section.. aka qCompress

      grep -r "qCompress" *
      corelib/tools/qbytearray.cpp: \fn QByteArray qCompress(const QByteArray& data, int compressionLevel)
      corelib/tools/qbytearray.cpp:QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
      corelib/tools/qbytearray.cpp: qWarning("qCompress: Data is null");
      corelib/tools/qbytearray.cpp: qWarning("qCompress: Z_MEM_ERROR: Not enough memory");
      corelib/tools/qbytearray.cpp: This function will uncompress data compressed with qCompress()
      corelib/tools/qbytearray.cpp: \sa qCompress()
      corelib/tools/qbytearray.h:Q_CORE_EXPORT QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
      corelib/tools/qbytearray.h:inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1)
      corelib/tools/qbytearray.h:{ return qCompress(reinterpret_cast<const uchar *>(data.constData()), data.size(), compressionLevel); }
      network/access/qnetworkdiskcache.cpp: are compressed using qCompress. Each cache file starts with "cache_"
      network/access/qnetworkdiskcache.cpp: out << qCompress(data.data());
      tools/rcc/rcc.cpp: qCompress(reinterpret_cast<uchar *>(data.data()), data.size(), m_compressLevel);

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jpalbertini
        wrote on last edited by
        #3

        Well I used the usual ones i think, from the wiki and other sources...
        -developer-mode
        -opensource
        -platform win32-msvc2010
        -static
        -opengl desktop
        -nomake examples
        -nomake demos

        1 Reply Last reply
        0
        • P Offline
          P Offline
          patrik08
          wrote on last edited by
          #4

          here i build static 5.1.1
          qt-everywhere-opensource-src-5.1.1.tar.xz

          on this way..
          ./configure -prefix /opt/icon/ -opensource -static -no-framework -no-xcb -release -silent
          i need this only to build installer or small apps..
          the best performance by qt apps is the shared lib variant...

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MarianMMX
            wrote on last edited by
            #5

            Method 1:
            In the other framework, look for zutil.h and zutil.c .
            Open those files, and rename z_errmsg to z_errmsg2 . Recompile.

            Method 2 (not recommended):
            Tell the compiler to ignore multiple definitions
            @
            cl /FORCE:MULTIPLE
            @

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jpalbertini
              wrote on last edited by
              #6

              thx for your replies,

              it worked fine with the 5.1.0 and 5.1.1 with the same options so i was hoping that it will be ok with the 5.2...

              i see what i can do with the first method thx :)

              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