zlib 1.2.8 编译笔记

What's zlib?

ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.8 is a general purpose data compression library.  All the code is thread safe.  The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).

All functions of the compression library are documented in the file zlib.h (volunteer to write man pages welcome, contact zlib@gzip.org).  Two compiled examples are distributed in this package, example and minigzip.  The example_d and minigzip_d flavors validate that the zlib1.dll file is working correctly.

官网下载:http://www.zlib.net/

编译环境:VS2008 32位

1 使用CMake生成Sln文件,同时会生成zconf.h

2 进入/contrib/masmx86,在 Visual Studio 2008 Command Prompt 环境下运行 bld_ml32.bat ,将生成的obj文件加入到上面sln工程的Additional Dependencies中

否则会提示编译错误:

1>zlibr.lib(deflate.obj) : error LNK2001: unresolved external symbol
_longest_match
1>zlibr.lib(deflate.obj) : error LNK2001: unresolved
external symbol _match_init

3 编译工程,OK

Zlib的头文件只有两个:zconf.h zlib.h

原文地址:https://www.cnblogs.com/vlan99/p/3678009.html