Results 1 to 2 of 2

Thread: QT + Zlib => error LNK2005: _deflate_copyright already defined in QtCored.lib(deflate

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Angry QT + Zlib => error LNK2005: _deflate_copyright already defined in QtCored.lib(deflate

    Hi,

    When I link my application I receive the following message :

    error LNK2005: _deflate_copyright already defined in QtCored.lib(deflate.obj) zlibstat.lib

    I'm not sure of the problem, but ... I use QT and ZLib. Both are "static libraries". The problem is that the QTCore.lib contains ZLib too !

    Project QT : contains its own version on ZLib
    Project GenericLib : use an external ZLib.lib (cannot be linked to QT)
    Project main : use QT + Generic lib

    As I say, I'm not sure that it is the problem. But, anyway, if someone has an idea to help me ?

    Thanks for your help

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT + Zlib => error LNK2005: _deflate_copyright already defined in QtCored.lib(def

    The problem is that the QTCore.lib contains ZLib too !
    Either rebuild qt without zlib (see the configure flag help) or don't link to the external zlib.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. LNK2005 error in VS2005 when statically building Qt App
    By pkloc in forum General Programming
    Replies: 9
    Last Post: 2nd July 2011, 01:36
  2. Replace -qt-zlib version from 1.2.3 to 1.2.5
    By sandor in forum Installation and Deployment
    Replies: 1
    Last Post: 28th April 2011, 08:41
  3. I've qtcored4, need qtcored
    By Nazgul in forum Installation and Deployment
    Replies: 1
    Last Post: 16th April 2011, 08:21
  4. Reference Error: google is not defined
    By pkarthick in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2011, 09:31
  5. Error::defined after prior declaration as dllimport:
    By hasnatzaidi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2009, 01:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.