CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Posts
    44

    undefined reference to deflate ...

    Hi !

    I am compiling a program including zlib with MinGW.
    I put zlib.h into MinGW\include and zlib1.dll into MinGW\lib.

    Compiles is fine but when linking generates a bunch of errors involving the zlib methods used in the program like the one in the title of this thread.

    Any idea ?

    Many thanks

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: undefined reference to deflate ...

    Quote Originally Posted by mulfycrowh View Post
    I am compiling a program including zlib with MinGW.
    I put zlib.h into MinGW\include and zlib1.dll into MinGW\lib.
    Linker needs a .lib file, not a .dll one!
    Last edited by VictorN; June 11th, 2014 at 02:14 PM.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2013
    Posts
    44

    Re: undefined reference to deflate ...

    Thanks for reply.
    I have MinGW 4.8.0 and zlib 1.2.5

    The library comes with a text file USAGE and they say :

    Using ZLIB1.DLL with gcc/MinGW
    ==============================

    1. Install the supplied header files "zlib.h" and "zconf.h"
    into the INCLUDE directory.

    2. Copy the supplied library file "zdll.lib" to "libzdll.a":
    cp lib/zdll.lib lib/libzdll.a

    OR

    2' Build the import library from the supplied "zlib.def":
    dlltool -D zlib1.dll -d lib/zlib.def -l lib/libzdll.a

    3. Install "libzdll.a" into the LIB directory.

    4. Add "libzdll.a" to your project, or use the -lzdll option.

    I tried the second option but it failed : dlltool tells that there is an error in zlib.def ???????????????? Why ?
    I do not understand the second point 2) of the first option.
    Could you explain please


    Thanks

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: undefined reference to deflate ...

    Quote Originally Posted by mulfycrowh View Post
    I tried the second option but it failed : dlltool tells that there is an error in zlib.def ???????????????? Why ?
    Why do ask us? You did not provide the exact error message, nor can we see what this zlib.def contains!

    Quote Originally Posted by mulfycrowh View Post
    I do not understand the second point 2) of the first option.
    1. Install the supplied header files "zlib.h" and "zconf.h"
    into the INCLUDE directory.

    2. Copy the supplied library file "zdll.lib" to "libzdll.a":
    cp lib/zdll.lib lib/libzdll.a
    Could you explain please
    What don't you understand? How to copy (or rename) file from "zdll.lib" to "libzdll.a"?
    Then look at the next line, it shows you how to do it using cp command!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured