Ubuntu 16.4
Trying to use the http
library with Crystal, I kept getting this SSL error.
$ crystal app.cr
_main.o: In function `__crystal_main':
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_library_init'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_load_error_strings'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: 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/vagrant/.cache/crystal/crystal-run-app.tmp' -rdynamic `command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'` -lpcre -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib
Workaround:
$ sudo apt-get install libssl1.1
# update crystal
$ sudo apt-get update
$ sudo apt-get install crystal