Crystal 构建因链接器错误而失败

Crystal build fails with linker error

我刚刚尝试 运行 语言文档中的简单 HTTP 服务器。该程序因错误而失败。

/usr/bin/ld: cannot find -lssl
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "/home/rasmus/dev/crystal/projects/hello/.crystal/crystal-run-hello.tmp" "${@}"  -rdynamic  -lssl -levent -lrt -lpcl -lpcre -lgc -lpthread -ldl`

程序已从the documentation复制粘贴。

我可以确认程序 did/does 运行 在我的客户机上,但在我的主机上没有。两者都是 Ubuntu 14.04.3 安装。

问题只是没有安装 SSL 库。如果你有同样的问题,你可以简单地 运行 sudo apt-get install libssl-dev。这应该安装修复错误所需的一切。