-
June 10th, 2014, 05:04 PM
#1
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
-
June 11th, 2014, 01:24 AM
#2
Re: undefined reference to deflate ...
Originally Posted by mulfycrowh
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
-
June 11th, 2014, 05:13 PM
#3
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
-
June 12th, 2014, 02:38 AM
#4
Re: undefined reference to deflate ...
Originally Posted by mulfycrowh
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!
Originally Posted by mulfycrowh
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|