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. Linking error with zlib library - LNK2019: unresolved external symbol _deflate referenced in function
Forum Updated to NodeBB v4.3 + New Features

Linking error with zlib library - LNK2019: unresolved external symbol _deflate referenced in function

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 2.2k 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.
  • R Offline
    R Offline
    rajendrasp79
    wrote on last edited by
    #1

    Hi,

    I am using deflate() method from the zlib library. I have setup the library path correctly in .pro file but still I am getting the linking error
    qzip.obj : error LNK2019: unresolved external symbol _deflate referenced in function "int __cdecl deflate(unsigned char *,unsigned long *,unsigned char const *,unsigned long)" (?deflate@@YAHPAEPAKPBEK@Z)

    Below is the code from .pro file
    win32:LIBS += -L$$PWD/../3rdParty/zlib/lib -lzlib

    Can you please help me in understanding what the issue is?

    Any help is really appreciated.

    JonBJ 1 Reply Last reply
    0
    • R rajendrasp79

      Hi,

      I am using deflate() method from the zlib library. I have setup the library path correctly in .pro file but still I am getting the linking error
      qzip.obj : error LNK2019: unresolved external symbol _deflate referenced in function "int __cdecl deflate(unsigned char *,unsigned long *,unsigned char const *,unsigned long)" (?deflate@@YAHPAEPAKPBEK@Z)

      Below is the code from .pro file
      win32:LIBS += -L$$PWD/../3rdParty/zlib/lib -lzlib

      Can you please help me in understanding what the issue is?

      Any help is really appreciated.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @rajendrasp79
      That deflate@@YAHPAEPAKPBEK@Z looks like a "decorated" name for a class member function or a namespace or something? I think zlib stuff is all non-class-global-methods (or is it)?

      1 Reply Last reply
      1
      • R Offline
        R Offline
        rajendrasp79
        wrote on last edited by
        #3

        I think that deflate is referring to the my local function. I have a static method named deflate() and I am calling library function deflate() from it

        JonBJ 1 Reply Last reply
        0
        • R rajendrasp79

          I think that deflate is referring to the my local function. I have a static method named deflate() and I am calling library function deflate() from it

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @rajendrasp79 said in Linking error with zlib library - LNK2019: unresolved external symbol _deflate referenced in function:

          I have a static method named deflate() and I am calling library function deflate() from it

          Show that bit of code, in case there is an issue there.

          Also, especially if it's Windows which it looks like, are you sure the compiler/linker you use (MSVC, MinGW) are consistent used across your code and the library you are trying to ling against?

          1 Reply Last reply
          1
          • R Offline
            R Offline
            rajendrasp79
            wrote on last edited by
            #5

            I got the fix, the problem was that the kit I was using was VS 2015 and the lib was probably built using VS 2017. I switched to VS 2017 and it is working fine

            1 Reply Last reply
            3

            • Login

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