Bug 3150 - Can't link programs that call crypt()
Can't link programs that call crypt()
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
5.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-05-30 00:10 EDT by josh
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-05-30 15:28:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description josh 1999-05-30 00:10:13 EDT
I get a linker error whenever I attempt to call the crypt
or fcrypt functions in a program I compile with gcc.  the
result is something like the following:

/tmp/cca070171.o: In function `main':
/tmp/cca070171.o(.text+0xe): undefined reference to `crypt'

Here is the program that give that error:

#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>

void main(void) {
    printf("%d\n", crypt("password", "Na"));
}

This doesn't occur under RedHat 4.2 or other systems not
using GLibc.
Comment 1 Jeff Johnson 1999-05-30 15:28:59 EDT
Add -lcrypt.

Note You need to log in before you can comment on or make changes to this bug.