[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I'm probably missing some c headers, but what ?



Oded Arbel writes:

 > I'm trying to write a c program that uses the crypt function
 > (char *crypt(const char *key, const char *salt) ) but when I try to
 > compile it, I get these error messages :
 > /tmp/cca119381.o: In function `passchek':
 > /tmp/cca119381.o(.text+0x64): undefined reference to `crypt'
 > /tmp/cca119381.o: In function `passchng':
 > /tmp/cca119381.o(.text+0x283): undefined reference to `crypt' 
 > 
 > I think I should have the relevant source some where around here (I have
 > the relevant man page, so I figured...) but I couldn't figure out which,
 > where, what and ..  ahmm... who ?

The only thing you need to do is add "-lcrypt" to the linking command
line. In glibc crypt is in its own library.


-- 
Alex Shnitman                            | http://www.debian.org
alexsh@hectic.net, alexsh@linux.org.il   +-----------------------  
http://alexsh.hectic.net    UIN 188956    PGP key on web page
       E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA

Software suppliers are trying to make their software packages more
"user-friendly".  ...  Their best approach, so far, has been to take all
the old brochures, and stamp the words, "user-friendly" on the cover.
	-- Bill Gates, Microsoft, Inc.