Because expect installs its shared libraries as symlinks libexpect.so.1 -> lib/expect5.45.4/libexpect5.45.4.so programs and libraries linked with -lexpect will fail to locate the final .so file. See https://lists.freebsd.org/pipermail/freebsd-tcltk/2020-February/000677.html Reported by: Daniel Morante <daniel@morante.net>