FAQ 3.5 KB
Newer Older
M
Mark Adler 已提交
1 2 3 4 5

		Frequently Asked Questions about zlib


If your question is not there, please check the zlib home page 
M
Mark Adler 已提交
6 7
http://www.zlib.org which may have more recent information.
The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
M
Mark Adler 已提交
8 9


M
Mark Adler 已提交
10
 1. Is zlib Y2K-compliant?
M
Mark Adler 已提交
11

M
Mark Adler 已提交
12
    Yes. zlib doesn't handle dates.
M
Mark Adler 已提交
13

M
Mark Adler 已提交
14
 2. Where can I get a Windows DLL version?
M
Mark Adler 已提交
15

M
Mark Adler 已提交
16 17 18
    The zlib sources can be compiled without change to produce a DLL. If you
    want a precompiled DLL, see http://www.winimage.com/zLibDll/ . Questions
    about the zlib DLL should be sent to Gilles Vollant (info@winimage.com).
M
Mark Adler 已提交
19

M
Mark Adler 已提交
20
 3. Where can I get a Visual Basic interface to zlib?
M
Mark Adler 已提交
21

M
Mark Adler 已提交
22 23 24 25
    See
        * http://www.winimage.com/zLibDll/cmp-z-it.zip
        * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm
        * contrib/visual-basic.txt in the zlib distribution
M
Mark Adler 已提交
26

M
Mark Adler 已提交
27
 4. compress() returns Z_BUF_ERROR
M
Mark Adler 已提交
28

M
Mark Adler 已提交
29 30 31 32
    Make sure that before the call of compress, the length of the compressed
    buffer is equal to the total size of the compressed buffer and not
    zero. For Visual Basic, check that this parameter is passed by reference
    ("as any"), not by value ("as long").
M
Mark Adler 已提交
33

M
Mark Adler 已提交
34
 5. deflate() or inflate() returns Z_BUF_ERROR
M
Mark Adler 已提交
35

M
Mark Adler 已提交
36 37 38
    Before making the call, make sure that avail_in and avail_out are not
    zero. When setting the parameter flush equal to Z_FINISH, also make sure
    that avail_out is big enough to allow processing all pending input.
M
Mark Adler 已提交
39

M
Mark Adler 已提交
40
 6. Where's the zlib documentation (man pages, etc.)?
M
Mark Adler 已提交
41

M
Mark Adler 已提交
42 43 44 45
    It's in zlib.h for the moment, and Francis S. Lin has converted it to a
    web page zlib.html. Volunteers to transform this to Unix-style man pages,
    please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage
    are in the files example.c and minigzip.c.
M
Mark Adler 已提交
46

M
Mark Adler 已提交
47
 7. Why don't you use GNU autoconf or libtool or ...?
M
Mark Adler 已提交
48

M
Mark Adler 已提交
49 50
    Because we would like to keep zlib as a very small and simple
    package. zlib is rather portable and doesn't need much configuration.
M
Mark Adler 已提交
51

M
Mark Adler 已提交
52
 8. I found a bug in zlib.
M
Mark Adler 已提交
53

M
Mark Adler 已提交
54 55 56 57
    Most of the time, such problems are due to an incorrect usage of
    zlib. Please try to reproduce the problem with a small program and send
    the corresponding source to us at zlib@gzip.org . Do not send
    multi-megabyte data files without prior agreement.
M
Mark Adler 已提交
58

M
Mark Adler 已提交
59
 9. Why do I get "undefined reference to gzputc"?
M
Mark Adler 已提交
60

M
Mark Adler 已提交
61
    If "make test" produces something like
M
Mark Adler 已提交
62

M
Mark Adler 已提交
63 64 65 66
       example.o(.text+0x154): undefined reference to `gzputc'
      
    check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
    /usr/X11R6/lib. Remove any old versions, then do "make install".
M
Mark Adler 已提交
67

M
Mark Adler 已提交
68
10. I need a Delphi interface to zlib.
M
Mark Adler 已提交
69

M
Mark Adler 已提交
70 71
    See the directories contrib/delphi and contrib/delphi2 in the zlib
    distribution.
M
Mark Adler 已提交
72

M
Mark Adler 已提交
73
11. Can zlib handle .zip archives?
M
Mark Adler 已提交
74

M
Mark Adler 已提交
75
    See the directory contrib/minizip in the zlib distribution.
M
Mark Adler 已提交
76

M
Mark Adler 已提交
77
12. Can zlib handle .Z files?
M
Mark Adler 已提交
78

M
Mark Adler 已提交
79 80
    No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
    the code of uncompress on your own.
M
Mark Adler 已提交
81

M
Mark Adler 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
13. How can I make a Unix shared library?

    make clean
    ./configure -s
    make

14. Why does "make test" fail on Mac OS X?

    Mac OS X already includes zlib as a shared library, and so -lz links the
    shared library instead of the one that the "make" compiled. For zlib
    1.1.3, the two are incompatible due to different compile-time
    options. Simply change the -lz in the Makefile to libz.a, and it will use
    the compiled library instead of the shared one and the "make test" will
    succeed.

15. I have a question about OttoPDF

    We are not the authors of OttoPDF. The real author is on the OttoPDF web
    site Joel Hainley jhainley@myndkryme.com.