Compiling a crystal program, is failing in linux mint 21 because of libpcre.so.1

When I try to run a crystal project, I am getting this error: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory can someone help me about this?

That happens when I run this command crystal hello-world.cr and if I try to install the libpcre I get the following mesage:

libpcre3 is already the newest version (2:8.39-13ubuntu0.22.04.1).
libpcre3-dev is already the newest version (2:8.39-13ubuntu0.22.04.1)

Welcome to crystal! I’m running linux mint 20.3 and haven’t had any problems setting up that I recall. To get past this error, you could try:

> sudo ln -s /usr/lib/x86_64-linux-gnu/libpcre.so /usr/lib/x86_64-linux-gnu/libpcre.so.1

To set up a soft link to the (presumably) existing libpcre.so file.

1 Like