stampeding
09-12-2000, 01:30 PM
Hello, I have a "cc" problem while
trying to compile a cgi script:
"man" says this about the function
"crypt":
<manText>
NAME
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] crypt - password and data encryption
SYNOPSIS
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] #define _XOPEN_SOURCE
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] #include <unistd.h>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] char *crypt(const char *key, const char *salt);
</manText>
Now, my C code looks like this:
<cCode>
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
.
.
.
[nbsp][nbsp][nbsp][nbsp]strcpy(cod,crypt(pwd,salt));
</cCode>
Still, I get this compiler error:
<errorMessage>
/tmp/cca198881.o: In function `fix_pwd':
/tmp/cca198881.o(.text+0xa0e): undefined reference to `crypt'
</errorMessage>
Why? Is some compiler option missing?
Note that it's NOT complaining that
"crypt" is an integer parameter in
strcpy, i.e. it's probably Ok in the
h-files.
However, it's missing while linking.
How can I fix this?
Regards,
/Stampeding[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]
trying to compile a cgi script:
"man" says this about the function
"crypt":
<manText>
NAME
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] crypt - password and data encryption
SYNOPSIS
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] #define _XOPEN_SOURCE
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] #include <unistd.h>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] char *crypt(const char *key, const char *salt);
</manText>
Now, my C code looks like this:
<cCode>
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
.
.
.
[nbsp][nbsp][nbsp][nbsp]strcpy(cod,crypt(pwd,salt));
</cCode>
Still, I get this compiler error:
<errorMessage>
/tmp/cca198881.o: In function `fix_pwd':
/tmp/cca198881.o(.text+0xa0e): undefined reference to `crypt'
</errorMessage>
Why? Is some compiler option missing?
Note that it's NOT complaining that
"crypt" is an integer parameter in
strcpy, i.e. it's probably Ok in the
h-files.
However, it's missing while linking.
How can I fix this?
Regards,
/Stampeding[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]