I was running make and encountered the following error:

gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory
config.status: error: could not create mjson.pc
Reaping losing child 0x564b30cbed70 PID 48255
make[1]: *** [Makefile:44: libmjson] Error 1
Removing child 0x564b30cbed70 PID 48255 from chain.
make[1]: Leaving directory '/home/minipc/econet/apps/public/libjson-1.5'

The libreadline.so.4 is too old to install in my current Linux machine (Ubuntu 20.04). So instead I installed libreadline.so.8, and created a symbolic link to libreadline.so.4. And I checked, it works:

lrwxrwxrwx 1 root root     25 Aug 12 21:17 /lib32/libreadline.so.4 -> /lib32/libreadline.so.8.0
lrwxrwxrwx 1 root root     18 Feb 25  2020 /lib32/libreadline.so.8 -> libreadline.so.8.0
-rw-r--r-- 1 root root 311884 Feb 25  2020 /lib32/libreadline.so.8.0

And the relevant part in Makefile is the following:

./configure  --prefix=/home/minipc/econet/apps/public/libjson-1.5 --libdir=/lib32 --includedir=/lib32 --disable-static --enable-shared \ 

And I checked it in the console output when running the make.

So why it still can't find libreadline.so.4? Is it because libreadline.so.8.0 too new to be linked by libreadline.so.4 so the program doesn't recognize it?

Also, when I run

$ ldconfig -p|grep libreadline
        libreadline.so.8 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.8
        libreadline.so.8 (libc6) => /lib32/libreadline.so.8
        libreadline.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.5

Only libreadline.so.5 and libreadline.so.4 appears. So the softlink would not be recognized by the system?

1

There are 1 best solutions below

0
li_jessen On

The libreadline.so.8 maybe too new to be used as the source of symbolic link of libreadline.so.4. Or it may need to be in another directory such as /lib to be linked by gawk.

I try $gawk return command not found . Then I run $sudo apt install gawk and check the gawk is of version GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0). I run $make again and found the same error.

Then I try $export $AWKPATH and find out that there is another path to store the gawk bin. Then I enter the directory and run $gawk, the same error pop out. I copy the /usr/bin/gawk ( the newly installed gawk) to update the gawk in the directory, and then run $gawk, it is the newest one.

Then I run $make again and the issue got solved.