I try to compile a library on linux. this libary uses <openssl/sha.h>
library. I have included this library in source file. After that, i use flag -lssl
and flag -lcrypto
to compile this project. So here is my command :
gcc -g -Wall -lssl -lcrypto -o bt_client file_a.c file_b.c
But I meet error :
undefined reference to `SHA1' at line 130
Code at line 130 is :
SHA1((unsigned char *) null_padded_name, 20, (unsigned char *)name_sha1);
Do I miss something ? Please correct me. Thanks :)
You need to provide -lssl and -lcrypto at the end of the command line:
gcc -g -Wall -o bt_client file_a.c file_b.c -lssl -lcrypto
Try this:
gcc -g -Wall -o bt_client file_a.c file_b.c -lssl -lcrypto
If you are sure that symbol SHA1
exists in libssl.so
or libcrypto.so
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With