Bug 3150 - Can't link programs that call crypt()
Summary: Can't link programs that call crypt()
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
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:

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


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