LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 05-10-2004, 09:31 PM   #1
liguorir
Member
 
Registered: May 2003
Posts: 256

Rep: Reputation: 30
Question Desperate crypt help.


-------------------------------------------------------------------------
Here's my program...
-------------------------------------------------------------------------
#include <stdio.h>
#include <unistd.h>
#include <crypt.h>

int main (int argc, char **argv) {

char salt[] = "aa";
char *password;

/* Read in the user's password and encrypt it. */
password = crypt ( argv[1], salt);

/* Print the results. */
puts ( password );

return 0;
}


-------------------------------------------------------------------------
Here's my error...
-------------------------------------------------------------------------
[root@lserver tmp]# gcc -o go main.c
/tmp/ccsQikMK.o(.text+0x32): In function `main':
: undefined reference to `crypt'
collect2: ld returned 1 exit status

-------------------------------------------------------------------------
Any help?
-------------------------------------------------------------------------
 
Old 05-11-2004, 01:22 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
I'm fairly certain this has nothing to do with Linux in Enterprise environments. You'll get more help here.

Please make sure to put posts in the relevant forum to the question you're asking.
 
Old 05-11-2004, 02:46 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Triple posting

Rules specifically state:

Do not post the same discussion in more than one forum. Duplicate discussions can be frustrating for other members. Try and pick the most relevant forum for your post. If you are unsure put it in Linux - General.
 
Old 05-11-2004, 06:47 AM   #4
arvind_sv
Member
 
Registered: Oct 2002
Location: Bangalore
Distribution: Gentoo Linux
Posts: 96

Rep: Reputation: 16
Hi,

Try compiling it as:
gcc -o go main.c -lcrypt

Arvind

PS: Tsk, tsk, running as root.
 
Old 05-11-2004, 10:12 AM   #5
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Please do not double post.

http://www.linuxquestions.org/rules.php

Closing thread.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No Crypt AMMullan Linux - Software 4 08-08-2007 03:48 AM
dm-crypt rino.caldelli Linux - Software 1 07-28-2005 09:06 PM
dm-crypt rino.caldelli Linux - Security 1 07-28-2005 12:46 PM
Crypt help liguorir Linux - Security 2 05-11-2004 09:44 AM
crypt IBP Linux - Software 3 03-03-2003 05:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration