Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 3150 - Can't link programs that call crypt()
Summary: Can't link programs that call crypt()
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-05-30 04:10 UTC by josh
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-05-30 19:28:42 UTC

Attachments (Terms of Use)

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:

#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.

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