Problem when I use and include Digest

Hello, recently in my project, I need to use the Digest library from Crystal. When I try to compile it in my Manjaro virtual machine, I have this issue:

/usr/bin/ld: _main.o: in function `__crystal_main':
/usr/lib/crystal/openssl/lib_ssl.cr:282: undefined reference to `SSL_library_init'
/usr/bin/ld: /usr/lib/crystal/openssl/lib_ssl.cr:282: undefined reference to `SSL_load_error_strings'
/usr/bin/ld: /usr/lib/crystal/openssl/lib_ssl.cr:282: undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/bin/ld: /usr/lib/crystal/openssl/lib_ssl.cr:282: undefined reference to `ERR_load_crypto_strings'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o /home/zohran/ism/ism -rdynamic -L/usr/bin/../lib/crystal `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lm -lgc -lpthread -levent -lrt -lpthread -ldl`
1 Like

This looks a lot like crystal doesn't work with OpenSSL 1.1.0f (Debian 9) · Issue #4680 · crystal-lang/crystal · GitHub. Try installing Arch Linux - pkgconf 1.8.0-1 (x86_64) and make sure openssl is up to date, then try again.