The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
So I need to do this assignment for a class where we hash passwords with a salt and the professor suggests we look into the openssl library by doing a man EVP_DigestInit. Now, I am terrible with C, so I figured I'd just compile the example provided (which can be seen here) and toy around with it to understand it better. However, upon trying to compile it, gcc shits the bed and I can't make heads or tails of what it tells me. Here's what I get:
Ok, so I found libssl.so and libssl.a on the machine, but adding those flags just bring up a lot of other "undefined references" in /usr/lib/libssl.so, in addition to the other undefined references from before.
Posts
To fix this, tell gcc where libssl is installed on your machine and to link with libssl.
e.g. gcc -o test test.c -lssl -L/usr/local/ssl/lib
(replace /usr/local/ssl/lib with whereever libssl.so or libssl.a is placed)
Try typing:
pkg-config openssl --libs
to see if that does anything. Mine gives me the output:
-L/usr/local/ssl/lib -lssl -lcrypto -ldl
If it gives a similar output on your machine, then type:
gcc -o test test.c `pkg-config openssl --libs`
Otherwise, try:
gcc -o test test.c -L/usr/lib -lssl -lcrypto -ldl
Wow. Aren't dependencies fun?
However, I tried the last thing line you gave without the -ldl and it worked fine.
And I just now remembered he gave us a Makefile, which of course has all of this stuff in it. Go me.
Regardless, thanks a lot for the help.