public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Newbie questions... (crypt())
@ 1998-07-18 17:29 Ben Greear
  1998-07-19 14:26 ` Carlo Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Greear @ 1998-07-18 17:29 UTC (permalink / raw)
  To: egcs

I just installed redhat 5.1 (Intel).  It comes with egcs, so I thought
I'd give it a whirl.  It caught several (non-fatal) mistakes in my code,
so I'm already impressed with it!

However, I use the crypt method:  char* crypt(const char*, const char*)
in my program.  egcs does not like it.  I popped up the man page, and
it says you need to #define _XOPEN_SOURCE
and #include <unistd.h>

I tried this, and still no luck.  Any information would be appreciated..

Ben

Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie questions... (crypt())
  1998-07-18 17:29 Newbie questions... (crypt()) Ben Greear
@ 1998-07-19 14:26 ` Carlo Wood
  1998-07-19 14:26   ` Ben Greear
  0 siblings, 1 reply; 4+ messages in thread
From: Carlo Wood @ 1998-07-19 14:26 UTC (permalink / raw)
  To: Ben Greear; +Cc: egcs

RedHat 5.1 uses glibc.  crypt is moved outside libc and now you
have to add -lcrypt to your linking process (in order to link
with /usr/lib/libcrypt.so -> ../../lib/libcrypt.so.1).

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

| I just installed redhat 5.1 (Intel).  It comes with egcs, so I thought
| I'd give it a whirl.  It caught several (non-fatal) mistakes in my code,
| so I'm already impressed with it!
| 
| However, I use the crypt method:  char* crypt(const char*, const char*)
| in my program.  egcs does not like it.  I popped up the man page, and
| it says you need to #define _XOPEN_SOURCE
| and #include <unistd.h>
| 
| I tried this, and still no luck.  Any information would be appreciated..
| 
| Ben
| 
| Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
| Author of ScryMUD:  mud.primenet.com 4444
| http://www.primenet.com/~greear/ScryMUD/scry.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie questions... (crypt())
  1998-07-19 14:26 ` Carlo Wood
@ 1998-07-19 14:26   ` Ben Greear
  1998-07-20 12:38     ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Greear @ 1998-07-19 14:26 UTC (permalink / raw)
  To: Carlo Wood; +Cc: egcs

On Sun, 19 Jul 1998, Carlo Wood wrote:

> RedHat 5.1 uses glibc.  crypt is moved outside libc and now you
> have to add -lcrypt to your linking process (in order to link
> with /usr/lib/libcrypt.so -> ../../lib/libcrypt.so.1).
> 
> -- 
>  Carlo Wood  <carlo@runaway.xs4all.nl>

I tried that.  It still won't compile without me adding:

extern char* crypt(const char* key, const char* salt);

to the top of each file that uses crypt (in other words, the #include
doesn't work right..)  After adding that, the code compiles to object
code, but the linking still fails, even after adding the -lcrypt.  Note
that I get no errors indicating that it couldn't find the crypt
library.

I would imagine there is something wrong with they way I'm trying to
include.  Since the man page neglected to tell about the -lcrypt, it
may be wrong in other ways as well.

Does anyone have any working (example) code using crypt?  Also, could
someone point me to some official repository of the man pages for glibc?

Thanks,

Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html


> 
> | I just installed redhat 5.1 (Intel).  It comes with egcs, so I thought
> | I'd give it a whirl.  It caught several (non-fatal) mistakes in my code,
> | so I'm already impressed with it!
> | 
> | However, I use the crypt method:  char* crypt(const char*, const char*)
> | in my program.  egcs does not like it.  I popped up the man page, and
> | it says you need to #define _XOPEN_SOURCE
> | and #include <unistd.h>
> | 
> | I tried this, and still no luck.  Any information would be appreciated..
> | 
> | Ben
> | 
> | Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
> | Author of ScryMUD:  mud.primenet.com 4444
> | http://www.primenet.com/~greear/ScryMUD/scry.html
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie questions... (crypt())
  1998-07-19 14:26   ` Ben Greear
@ 1998-07-20 12:38     ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 1998-07-20 12:38 UTC (permalink / raw)
  To: Ben Greear; +Cc: carlo, egcs

> 
> 
> On Sun, 19 Jul 1998, Carlo Wood wrote:
> 
> > RedHat 5.1 uses glibc.  crypt is moved outside libc and now you
> > have to add -lcrypt to your linking process (in order to link
> > with /usr/lib/libcrypt.so -> ../../lib/libcrypt.so.1).
> > 
> > -- 
> >  Carlo Wood  <carlo@runaway.xs4all.nl>
> 
> I tried that.  It still won't compile without me adding:
> 
> extern char* crypt(const char* key, const char* salt);
> 
> to the top of each file that uses crypt (in other words, the #include
> doesn't work right..)  After adding that, the code compiles to object
> code, but the linking still fails, even after adding the -lcrypt.  Note
> that I get no errors indicating that it couldn't find the crypt
> library.
> 
> I would imagine there is something wrong with they way I'm trying to
> include.  Since the man page neglected to tell about the -lcrypt, it
> may be wrong in other ways as well.
> 
> Does anyone have any working (example) code using crypt?  Also, could
> someone point me to some official repository of the man pages for glibc?

Yes, login, pine, .... Post a small testcase. I will a take a look.

H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-07-20 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-18 17:29 Newbie questions... (crypt()) Ben Greear
1998-07-19 14:26 ` Carlo Wood
1998-07-19 14:26   ` Ben Greear
1998-07-20 12:38     ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).