Search code examples
crystal-langkemal

Undefined references on run, SSL


Trying out Kemal in a VM, fresh install of Arch-Linux with gc, openssl, crystal, and shard packages. Ran through steps on Kemal guide for simple web app, but errors upon crystal run src/test_app.cr:

_main.o: In function '__crystal_main':
/usr/lib/crystal/openssl/lib_ssl.cr:213: undefined reference to 'SSL_Library_init'

...followed by a lot of similar error messages, undefined references etc.

Am I missing a dependency?


Solution

  • Install the base-devel package group using pacman -S base-devel.

    On Arch Linux, Crystal is a compiler package so it assumes you have base-devel installed. Without the pkg-config package, Crystal can't find out which version of OpenSSL you have installed and can't link to it.