none
Zlib and LNK2019: unresolved external symbol

Answers

  • >unresolved external symbol _deflateEnd@4
    >I'm building everything with 64 bit.

    This may be a clue:

    _deflateEnd@4

    Look in the 32-bit zlibwapi.lib and you will find this
    symbol defined.

    Look in the X64 zlibwapi.lib and you will NOT find this
    symbol defined. Instead it has:

    deflateEnd

    - Wayne
    • Marked as answer by _VeTaL_ Friday, October 28, 2011 4:58 PM
    Friday, October 28, 2011 2:38 PM

All replies

  • Are you building a 64-bit program or 32-bit?

    Since you're using zlibwapi.dll did you define ZLIB_WINAPI
    in your source file(s) before the include directives?

    - Wayne

    • Edited by WayneAKing Thursday, October 27, 2011 6:04 AM
    Thursday, October 27, 2011 6:03 AM
  • Thanks for fast answer.

    1. I'm building everything with 64 bit.


    2. Yep, i have

    #define ZLIB_WINAPI
    #include "zlib.h"


    Right now i re-checked everything, removed all #pragma comment(lib, "zlibwapi.lib"), leaved only path to library at "Linker/General/Additional Library Directories" and library name at "General/Input/Additional Dependencies"

    and still got the same result

     

    Log shows as before - looking like linker doesnt look inside zlibwapi.lib:

    1> Searching libraries

     

    1> Searching ..\Libs\zlib125dll\dllx64\zlibwapi.lib:

     

    1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:

     

     

    Friday, October 28, 2011 10:23 AM
  • >unresolved external symbol _deflateEnd@4
    >I'm building everything with 64 bit.

    This may be a clue:

    _deflateEnd@4

    Look in the 32-bit zlibwapi.lib and you will find this
    symbol defined.

    Look in the X64 zlibwapi.lib and you will NOT find this
    symbol defined. Instead it has:

    deflateEnd

    - Wayne
    • Marked as answer by _VeTaL_ Friday, October 28, 2011 4:58 PM
    Friday, October 28, 2011 2:38 PM
  • Well yes, you was right about 32 and 64-bit versions.

    I'm not sure if i solved it right: i just linked to 32-bit-version of zlibwapi.lib and dll, but it works now. (i dont know how to change _deflateEnd@4 to deflateEnd)

     

    Moreover, i found that usually #define ZLIB_WINAPI is used kinda

    #ifdef _WIN32
        #define ZLIB_WINAPI
    #endif
    #include "zlib.h"
    

     So, looking like ZLIB_WINAPI is used only with win32.

     

    Generally, looking like the problem is solved now, but i'll appreciate if you would add more comments.


    • Edited by _VeTaL_ Friday, October 28, 2011 4:59 PM
    Friday, October 28, 2011 4:58 PM
  • I suggest you send an email with your questions re
    32-bit vs. 64-bit to:

    Gilles Vollant
    info@winimage.com

    - Wayne
    Friday, October 28, 2011 7:23 PM