* Good kernel, bad libs
@ 1997-01-23 7:04 Liam Irish
0 siblings, 0 replies; 2+ messages in thread
From: Liam Irish @ 1997-01-23 7:04 UTC (permalink / raw)
Thanks for the help with the kernel. It works, now:
I am trying to write a password encryption program. Here is a sample.
This compiles fine and works under x86 linux:
#begin code
1 //testing out encryption streams
2 #include <fstream.h>
3 #include <unistd.h>
4 void main()
5 {
6 ofstream of("..passwdfile");
7 of<<crypt("Simon","ff")<<"\n"
8 }
crypt is not in unistd.h under alpha. It apparently is in crypt.h (which
I changed the alpha version to include), however, using that yields this
error:
/tmp/cca081481.o: In function `main':
filetest.c++(.text+0x8c): undefined reference to `crypt(char const *, char
const *)'
filetest.c++(.text+0x90): undefined reference to `crypt(char const *, char
const *)'
I am assuming maybe I am missing a .o file or something, but would rather
not mess with my libraries unless I must. Must I? Thanks.
Liam
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Good kernel, bad libs
[not found] <Pine.SUN.3.95.970123015458.12682A-100000@soleil>
@ 1997-01-24 20:41 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 1997-01-24 20:41 UTC (permalink / raw)
> crypt is not in unistd.h under alpha.
A random sampling of other Unix vendors showed only about half
had crypt in unistd.h, while most had crypt.h as well. As glibc
(like everyone else in this country) is forced to distribute the
crypt functions separately, we decided to keep things clean and
leave it out of unistd.h.
> /tmp/cca081481.o: In function `main':
> filetest.c++(.text+0x8c): undefined reference to `crypt(char const *, char
> const *)'
There are two potential problems here: first your version of crypt.h
doesn't do the C++ extern "C" protection bits, so the external name
of the function is mangled.
Second, did you remember to include -lcrypt on the link line?
r~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-01-24 20:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-01-23 7:04 Good kernel, bad libs Liam Irish
[not found] <Pine.SUN.3.95.970123015458.12682A-100000@soleil>
1997-01-24 20:41 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox