pitosalas
pitosalas

Reputation: 10852

Crystal lang error: "library not found for -lssl "

I am porting a simple program from Ruby to Crystal. I've written a spec test for it. The program being tested needs to do some http so I tried using the http library and as an alternative the crest library. In both cases trying to run gives me this error. It looks like some library is missing but hard to see which one or what the right way to fix it is.

ld: library not found for -lssl [33;1m(this usually means you need to 
install the development package for libssl)[0m
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: cc "${@}" -o '/Users/pitosalas/.cache/crystal/crystal-run-hue.tmp' -rdynamiccommand -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' -lpcre -lgc -lpthread /usr/local/Cellar/crystal/0.26.1_1/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -L/usr/local/lib`"

(I'm porting a small program from ruby to crystal) it does away when I remove the line "require "http/client

Upvotes: 1

Views: 302

Answers (1)

Samual
Samual

Reputation: 188

What OS/distro are you using? It says you need the libssl development package.

If you are on Debian/Ubuntu:

sudo apt install libssl-dev

Or for others it should be listed here or maybe here

Upvotes: 1

Related Questions