I\'m using GCC 4.6.0 (on an otherwise unidentified platform).
I am using the crypt()
function to encrypt a password.
I have never used
It also says #define _XOPEN_SOURCE
(before including unistd.h
) in my man page. So you should probably add it to expose the declaration of crypt
.
EDIT
I just tried it. Including unistd.h
and #define _XOPEN_SOURCE
before it does the trick. Including it alone isn't enough.
Using
gcc version 4.6.0 20110429
GNU C Library stable release version 2.13
Looking into unistd.h
:
/* XPG4.2 specifies that prototypes for the encryption functions must
be defined here. */
#ifdef __USE_XOPEN
/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
extern char *crypt (__const char *__key, __const char *__salt)
__THROW __nonnull ((1, 2));