Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <000b01c0ee4f$4c52dd60$03e897ca@localhost> From: "kalmen chia" To: Subject: 1.3.2: question about zlib -undefine referemce to "Compress" Date: Wed, 6 Jun 2001 14:09:49 +0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0007_01C0EE92.5958C680" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2615.200 ------=_NextPart_000_0007_01C0EE92.5958C680 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0008_01C0EE92.5958C680" ------=_NextPart_001_0008_01C0EE92.5958C680 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear , After I compiled , it gave me this msg. zc.o(.text+0x159):zc.c: undefined reference to `compress' collect2: ld returned 1 exit status make: *** [zc] Error 1 =20 what happends to my code ? TQ for your attention =20 =20 =20 best regards kalmen --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.252 / Virus Database: 125 - Release Date: 09/05/2001 ------=_NextPart_001_0008_01C0EE92.5958C680 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear ,
After I compiled , it gave me this=20 msg.
 
zc.o(.text+0x159):zc.c: undefined = reference to=20 `compress'
collect2: ld returned 1 exit status
make: *** [zc] = Error=20 1
 
what happends to my code ? TQ for your=20 attention
 
 
 
best regards
kalmen
 
 

---
Outgoing mail is certified = Virus=20 Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: = 6.0.252 /=20 Virus Database: 125 - Release Date: = 09/05/2001
------=_NextPart_001_0008_01C0EE92.5958C680-- ------=_NextPart_000_0007_01C0EE92.5958C680 Content-Type: application/octet-stream; name="zc.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zc.c" /*=0A= * $Id: zc.c,v 1.1 2001/01/29 15:10:04 york Exp $=0A= *=0A= * This program is used to build Palm OS database containing Bible text.=0A= * It compresses particular chapters using zlib compression library.=0A= *=0A= * To successfully build this program install zlib-devel-*.rpm package.=0A= */=0A= =0A= #include =0A= #include =0A= =0A= #define BUF_SIZE (1024*64)=0A= =0A= int main(int argc, char **argv)=0A= {=0A= char src[BUF_SIZE], dst[BUF_SIZE];=0A= unsigned long src_len, dst_len =3D sizeof(dst);=0A= FILE *fd;=0A= int res;=0A= =0A= // check input params=0A= if(argc !=3D 3)=0A= {=0A= printf("%s source destination\n", argv[0]);=0A= return 0;=0A= }=0A= =0A= // read file into the memory=0A= if((fd =3D fopen(argv[1], "rb")) !=3D NULL)=0A= {=0A= src_len =3D fread(src, 1, sizeof(src), fd);=0A= fclose(fd);=0A= }=0A= else=0A= {=0A= printf("Can't open file '%s' for reading\n", argv[1]);=0A= return -1;=0A= }=0A= =0A= // compress the file=0A= res =3D compress(dst, &dst_len, src, src_len);=0A= if(res !=3D Z_OK)=0A= {=0A= printf("Error in compression\n");=0A= return -1;=0A= }=0A= =0A= // write compressed file=0A= if((fd =3D fopen(argv[2], "wb")) !=3D NULL)=0A= {=0A= fputc(0xFF & (src_len >> 8), fd);=0A= fputc(0xFF & (src_len ), fd);=0A= =0A= fwrite(dst, 1, dst_len, fd);=0A= fclose(fd);=0A= }=0A= else=0A= {=0A= printf("Can't write file '%s'\n", argv[2]);=0A= return -1;=0A= }=0A= =0A= return 0;=0A= }=0A= ------=_NextPart_000_0007_01C0EE92.5958C680 Content-Type: text/plain; charset=us-ascii -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple ------=_NextPart_000_0007_01C0EE92.5958C680--