中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-14 22:38
楼 主 请教,C编程的压缩zlib问题 发表于 2006-12-25 01:01 ·  中国 陕西 西安 电信
新手上路
积分 16
发帖 4
注册 2006-12-10 07:05
UID 73093
性别 男
状态 离线
我用得是wintc 1.9.1在WINDOSWS下编程,我下载了zlib-1.2.3,并把 zlib.H,ZCONF.H复制到C:\Win-TC\Include中,当我连接下面的代码就出问题了:

#include <bios.h>
#include <conio.h>
#include <stdio.h>
#include "zlib.h"
#ifdef STDC
# include <string.h>
# include <stdlib.h>
#endif

#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#else
# define SET_BINARY_MODE(file)
#endif
main()
{
char a[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
char *bout1,*bout2;
int dstLen,result;
result=0;
bout1=&a;
bout2=&a;
dstLen=16;
result=compress(bout1,&dstLen,bout2,16);
printf("%s",&bout1);
getch();
}

一直提示 "未定义的符号 '_compress' 在模块 noname.c"
noname.c为我这段代码的文件.

请问这是咋回事?麻烦请您给我修改一下?
还有能不能把压缩和解压缩的都给写下来?

谢谢!!!!!!!!
2 发表于 2006-12-28 05:10 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
积分 5,154
发帖 1,827
注册 2003-07-18 00:00
UID 7105
性别 男
状态 离线
已在编程论坛答复了..
论坛跳转: