help-gplusplus
[Top][All Lists]
Advanced

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

Re: Linking the functions in pi-md5.h


From: Paul Pluzhnikov
Subject: Re: Linking the functions in pi-md5.h
Date: Wed, 25 Apr 2007 16:55:09 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Robert Cahn" <robertscahn@gmail.com> writes:

> I need to write a little program that computes an md5 checksum.  In 
> /usr/include there is a nice header file that includes
> the functions
> void MD5Init(struct MD5Context *context);
> void MD5Update(struct MD5Context *context, UINT8 const *buf, unsigned len);
> void MD5Final(unsigned char digest[16], struct MD5Context *context);
> void MD5Transform(UINT32 buf[4], UINT32 const in[16]);
> void byteSwap(UINT32 * buf, unsigned words);
> When I do
> #include " pi-md5.h" the code compiles but the linker can't find the 
> function.  Does anybody know what library contains
> the code?

The way to find out:

$ rpm -qf /usr/include/pi-md5.h 
pilot-link-devel-0.11.8-16

$ rpm -ql pilot-link-devel | egrep '\.a|\.so'
/usr/lib64/libpisock++.a
/usr/lib64/libpisock++.so
/usr/lib64/libpisock.a
/usr/lib64/libpisock.so
/usr/lib64/libpisync.a
/usr/lib64/libpisync.so

$ rpm -ql pilot-link-devel | grep '\.a' | xargs nm -A  | grep MD5Final
/usr/lib64/libpisock.a:md5.o:0000000000000c00 T MD5Final

$ rpm -ql pilot-link-devel | grep '\.so' | xargs nm -A -D | grep MD5Final
/usr/lib64/libpisock.so:0000003be5812c00 T MD5Final

Note that linking with PalmPilot-devel libs is probably not a very good idea.
On my system, libcrypt.* and libcrypto.* also contain MD5:

$ nm -A libcrypt*.a 2>/dev/null | grep -i md5
...
libcrypt.a:md5-crypt.o:0000000000000870 T __md5_crypt
libcrypt.a:md5-crypt.o:0000000000000000 T __md5_crypt_r
...
libcrypto.a:md5_dgst.o:0000000000000040 T MD5_Final
libcrypto.a:md5_dgst.o:0000000000000000 T MD5_Init
libcrypto.a:md5_dgst.o:00000000000001b0 T MD5_Transform
libcrypto.a:md5_dgst.o:00000000000001c0 T MD5_Update
libcrypto.a:md5_dgst.o:0000000000000000 D MD5_version
...


Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]