Mail Archives: cygwin/2001/03/23/14:26:51
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 -