如何在vc2010中使用zlib

如何在vc2010中使用zlib,第1张

Installing ZLIB1.DLL

====================

Copy ZLIB1.DLL to the SYSTEM or the SYSTEM32 directory.

Using ZLIB1.DLL with Microsoft Visual C++

=========================================

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

into a directory found in the INCLUDE path list.

2. Install the supplied library files "zdll.exp" and "zdll.lib"

into a directory found in the LIB path list.

3. Add "zdll.exp" or "zdll.lib" to your project.

Notes:

- Usually, you don't need both the .exp file and the .lib file.

- If you wish, you may rename "zdll.exp" to "zlib1.exp", and/or

rename "zdll.lib" to "zlib1.lib".

我就把zlib.h、zconf.h、zlib1.lib加到工程里,把zlib1.dll放到当前目录下,就可以用了

1 准备工作。

下载zlib.dll。以及相关头文件。将dll文件及头文件加入工程。

2 压缩

调用函数compress.

形式为

int compress(Byte * dest, uLong* destLen, const Byte *source, ULONG sourceLen)

功能是将source指向的空间,长度为sourceLen的数据进行压缩,压缩数据储存在dest中,长度由参数destLen返回

如果压缩出错,返回对应错误号,否则返回0.

3解压缩:

调用函数uncompress.

形式为

int uncompress(Byte * dest, uLong* destLen, const Byte *source, ULONG sourceLen)

功能是将source指向的空间,长度为sourceLen的数据进行解压缩,解压缩后的数据储存在dest中,长度由参数destLen返回。

如果解压缩出错,返回对应错误号,否则返回0.


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/7957642.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-12
下一篇2023-04-12

发表评论

登录后才能评论

评论列表(0条)

    保存