delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/23/14:26:51

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3ABBA1FF.8513578F@lucent.com>
Date: Fri, 23 Mar 2001 14:20:31 -0500
From: Yomyung Leem <leemy AT lucent DOT com>
Reply-To: leemy AT lucent DOT com
Organization: Lucent Technologies
X-Mailer: Mozilla 4.6 [en]C-CCK-MCD EMS-1.4 (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: I need help on compiling
References: <3ABB7E99 DOT 25C59A56 AT mizuhocap DOT com> <4 DOT 3 DOT 1 DOT 2 DOT 20010323135843 DOT 02014950 AT pop DOT ma DOT ultranet DOT com>

I am having a trouble compiling the following C source. (Attached at the tail of
this message)

I get the following message:

C:\CSL>make makekey
gcc     makekey.c   -o makekey
makekey.c: In function `main':
makekey.c:64: warning: assignment makes pointer from integer without a cast
/cygdrive/c/TEMP/ccgqdRim.o(.text+0x44):makekey.c: undefined reference to `crypt
'
collect2: ld returned 1 exit status
make: *** [makekey] Error 1

I have downloaded the latest cygwin, (DLL version 1.1.8).

Any help would be appreciated!!

Thanks,
Yung

===========================  makekey.c 
=========================================

#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1990, 1993\n\
	The Regents of the University of California.  All rights reserved.\n";
#endif /* not lint */

#ifndef lint
static char sccsid[] = "@(#)makekey.c	8.1 (Berkeley) 6/4/93";
#endif /* not lint */

#include <sys/types.h>

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static void get (char *, int);

int
main()
{
	int len;
	char *r, key[9], salt[3];

	get(key, sizeof(key) - 1);
	get(salt, sizeof(salt) - 1);
	len = strlen(r = crypt(key, salt));
	if (write(STDOUT_FILENO, r, len) != len)
		perror("stdout");
	exit(0);
}

static void
get(bp, len)
	char *bp;
	register int len;
{
	register int nr;

	bp[len] = '\0';
	if ((nr = read(STDIN_FILENO, bp, len)) == len)
		return;
	if (nr >= 0)
		errno = ENODATA;
	perror("stdin");
}

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019