Bug 3150

Summary: Can't link programs that call crypt()
Product: [Retired] Red Hat Linux Reporter: josh
Component: gccAssignee: David Lawrence <dkl>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-05-30 19:28:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description josh 1999-05-30 04:10:13 UTC
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 19:28:59 UTC
Add -lcrypt.