crypt() usage
ASe User
menzies1@airmail.net
Mon Jul 10 22:31:00 GMT 2000
Hi,
I'm running in a shell in FreeBSD 3.2 and using GCC to write CGI scripts. I'm trying to use crypt() in the following program
$ cat systest.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <des.h>
//#include <io.h>
void main()
{
char *cryptpass;
strcpy(cryptpass,crypt("firstpas","as"));
}
and getting the error:
$ gcc -g systest.c
/var/tmp/ccm266661.o: In function `main':
/www/cgi-bin/classcgi/cgisrc/src/systest.c(.text+0x1e): undefined reference to `crypt'
My questions are:
1) I greped crypt and it showed up in unistd.h and des.h. Are there other headers that I should include? How do I get it referenced?
2) What is the correct usage for crypt? [Eg. Char *crypt(char *pass, char *salt)] Do you have an example in c?
This info could probably come from man but that is disabled in my shell. Is there a gcc library reference available on the web?
Thanks and regards,
Wes
More information about the Gcc-bugs
mailing list