[cs631apue] Question About the RAND_bytes

bzhang41 bzhang41 at stevens.edu
Sat Dec 3 18:57:55 EST 2016


Hi Smith,

I tried to use -lcrypto, it still cannot work
I just used

cc -Wall -lcrypto aed.c

Is this the way you mean ?



Bradford Smith wrote:
To use the OpenSSL cryptography functions you need to link against
libcrypto (-lcrypto).

Perhaps you forgot this step?

Bradford Smith





On 2016-12-03 17:58, bzhang41 wrote:
> Dear all,
> 
> Do you know why I cannot compile the program, when I use the
> RAND_bytes(3) to generate the salt ?
> 
> I include the header #include <openssl/rand.h>,
> but it still says undefined reference to `RAND_bytes`. I didn't find
> any solution on the web.
> Can anyone tell me how to fix it ?
> 
> 
> Thanks
> Bo


More information about the cs631apue mailing list